Home


Command-based invalidation

You can also invalidate entries in the cache through command-based invalidation using dependency and invalidation IDs. A cache-entry needs 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 with it. You can build a dependency tree, so that when object x is refreshed, so are objects y and z, and so on.

These entries are invalidated using command-based invalidation rules. Command-based invalidation means invalidation IDs are generated upon execution of a command. These invalidation IDs are constructed based on the methods and fields provided by the commands. When a request causes invalidation IDs to be generated, the entries in the cache that have a dependency ID matching the generated invalidation ID are invalidated.

To have cache invalidation triggered by a command, first declare the dependency-id components for the cache-entries you want to invalidate. The dependency-id components represent the components that, should they change, would invalidate the content of this cache entry. See Example | -4 for an illustration of command-based invalidation.

+

Search Tips   |   Advanced Search