Home


11.6 Invalidation

What: Invalidation is the term applied to a number of different techniques used to flag cache entries as out-of-date and force their eviction from the cache. Next time the page or page fragment is requested, or the command re-executed, the content is re-generated and the cache entry stored away for use next time.

How: The simplest (and discouraged) method of invalidation is to used a time-based method. Usually, time-based methods do not make best use of the cache and do not guarantee accurate (timely) page contents.

The recommended cache invalidation technique is to use fine-grained invalidation methods like command-based invalidation using dependency and invalidation IDs. A cache entry has dependency IDs defined for each component that it relies on. When an object is cached for this entry, the dependency IDs are generated and associated to it. Invalidation IDs are constructed based on methods and fields generated by command-based invalidation commands. When an invalidation ID is generated, the entries in the cache that have a dependency ID matching the generated invalidation ID are invalidated.

A final way to configure automatic cache invalidation is using the CACHEIVL table in combination with database triggers.

See DynaCache invalidation.

Why: Invalidation is essential to remove out of date cache entries so they can be regenerated with different contents. We recommend using invalidation rules to automate the invalidation of cache entries. This allows you to maximize the time content stays in the cache as well it make sure that any content change is presented to customers immediately.

If you do not have invalidation rules configured, then we will need to invalidate all of the cache when content changes. This means that everything will be removed from the cache, not just the changed pages. The invalidation of the complete cache is not recommended and should be avoided whenever possible. See Chapter 3 for more detailed information on fragment caching.

+

Search Tips   |   Advanced Search