Understanding report caching
Starting with version 6.17.0 of Reporting for Confluence, a new feature to cache the report output has been introduced. The Report caching feature is disabled by default and must be enabled from the Reporting Admin Config by an admin.
Once enabled, all reports with result types of content (pages, blog posts, attachments, comments,...), spaces, and users will be written to the “ServiceRocket Reporting Cache” after the first render. Then, all subsequent renders of the same report will be loaded from the cache until the time-to-live (TTL) expires after 24 hours by default.
Pros and Cons of report caching
Pros | Cons |
---|---|
|
|
Notes The freshness of data concerns is mitigated because fresh data will be used and the cache will be invalidated if:
|
Flushing Reporting cache
Usually, the cache will expire after the TTL expires and the report output data will automatically refresh and renew. However, occasionally, it may be required to flush the cache manually. In that scenario, you can flush the cache for:
- Individual Reports: Change the value of any parameter in the report. Alternatively, edit the body of any of the macros in the report. This will create a new cache key for the report enabling new data to be fetched and cached.
- All Reports: System admins can use the flush cache button on the Reporting Admin Config page.
Optimizing Reporting cache
By default, Reporting cache has a size of 1,000 entries with a TTL of 24 hours. While this default configuration is good for most medium-sized instances, it is not one size fits all. Both the TTL and cache sizes can be configured and changed if needed. Refer to Atlassian’s cache performance tuning guide for general tips on fine-tuning the cache configuration. Additionally, consider:
- Longer TTL may benefit from larger cache sizes.
- A larger cache size may consume more memory, only increase it if required.
- Review the cache hit/miss/eviction ratios for “ServiceRocket Reporting Cache” from "<base-url>/admin/cache/showStatistics.action#fullView" to determine the best values for your instance.
Debugging Reporting cache
You can enable the debug logs to view the Reporting performance logs and watch the report caching in action. To do so, follow these steps:
- Enable performance logging.
- Watch the logs for:
- 'Cache miss!': When rendering the report for the first time.
- 'Cache Write!': Following the previous log to add a new cache entry.
- 'Cache hit!': Upon viewing the same report again before the TTL expires.
Performance comparison
These results were collected on a Confluence 7.19.1 instance with just over 1,000 spaces and 5,000 users. The rendering time data was for a Report Table with 5 columns each using Report Info for output with Link to Item. Each reading was taken at least twice and averaged.
These performance metrics are not meant as absolute benchmarks of expected performance but more as a relative measure of the expected performance gains when caching is enabled.