Introduction
Caching allows for improved performance in response to report queries. Although the use of caching is an advantage, there are instances when caches may expire or become invalid. Some of these instances are:
- When there are changes made to the objects in the data warehouse, the existing caches may be configured so that they are no longer valid when hitting certain warehouse tables. Any further report execution will no longer hit the cache.
- When the definition of an application object changes (such as a report definition, report, template, metric definition, etc.), the related report cache is marked as invalid.
- When there is a need to control the growth of caches on the Strategy Intelligence Server, old caches may need to be expired automatically.
Invalidating Report Caches
Invalidation is a preventive measure that renders a cache unusable by nullifying it. Cache invalidation only applies to Matching caches and Matching-History caches. It makes the cache ineligible in the matching process so it is not used to fulfill a report request.
- In the case of a Matching cache, invalidating it will automatically result in deleting it.
- In the case of a Matching-History cache, invalidation simply converts it to a History cache that is not used in the matching process any more but is still accessible through History List messages that reference it. However, if all these messages are deleted, the converted History cache that is referenced is also deleted.
Expiring Report Caches
Cache expiration is a process that renders a cache unusable by terminating its useful life. It yields the same results as invalidating a cache and applies to Matching caches and Matching-History caches. Cache expiration occurs automatically as per the 'Report cache duration' setting which can be found under Project Configuration > Reports >Advanced > Caching.
When a cache is updated, the current cache lifetime is used to determine the cache expiration date based on the last update time of the cache. This means that changing the Report cache duration setting does not affect the expiration date of the already existing caches. It only affects the new caches that are being or will be processed.
Deleting Report Caches
Cache deletion is a process that deletes the cache from memory as well as disk. Report caches are automatically deleted by Strategy Intelligence Server if cache invalidation and History Lists are performed and maintained properly.
- In the case of a History cache, deleting it does not automatically delete the associated History List messages that reference it. After deleting a History cache, when a message that references it is retrieved, the following occurs:
- Strategy Web users see an error message, "Execution results not available. Would you like to re-execute?"
- Strategy Desktop users do not see the above error message because Strategy Desktop automatically resubmits the report for execution.
- On the other hand, a History cache is automatically deleted when all the History List messages that reference it are deleted (when its History List reference count reaches 0).
- In the case of a Matching-History cache, when all the History List messages that reference it are deleted, it is simply converted to a Matching cache, while losing its History component.
Caches can be deleted:
- Manually - via Cache Monitor and Strategy Command Manager
- Scheduled - via Strategy Desktop Scheduled Administrative Task.
Purging Report Caches
Cache Purging is a process whereby all report caches can be deleted in bulk, even the one references by History List messages.
Notes:
- The only difference between invalidating and expiring caches is the mechanism involved. Invalidating a cache typically takes place at a set event (like on data warehouse load) while the expiring a cache is set for a period of time (like 48 hours).
- Once the cache is marked, the status of the cache is checked and all the caches which are invalid/expired are removed from the cache lookup table. This clears old caches and makes space for new ones.
- The difference between purging and deleting caches is that purging automatically eliminates all caches in a project, while deletion can be performed for individual report caches.