Contact Us 1-800-596-4880

Invalidate Cache (<ee:invalidate-cache/>)

Invalidate the complete cache in the referenced caching strategy.

Invalidate cache entries when you want the Cache Scope to recalculate the value for those cache entries. Alternatively, you can configure the caching strategy to invalidate entries automatically based on time by setting the entryTtl parameter in the defined custom object store.

Component XML

This component supports the following XML structure:

<ee:invalidate-cache
  cachingStrategy-ref=""
  doc:name="Invalidate cache"
  doc:id="kacopu" />

Invalidate Cache (<ee:invalidate-cache/>) attributes are configurable through the UI and XML.

Attribute Name Attribute XML Description

Invalidate cache (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Cachingstrategy ref

cachingStrategy-ref

Reference to the caching strategy for the cache to invalidate.

Examples

The following examples show how to manually invalidate a cache and how to set automatic invalidation for a caching strategy.

Example: Invalidating a Cache

The following example invalidates the complete cache in the referenced caching strategy.

<!-- Caching strategy configuration -->
<ee:object-store-caching-strategy name="myCachingStrategy" />

<flow name="cacheFlow">
  <ee:cache cachingStrategy-ref="myCachingStrategy">
      <!-- Processing logic inside the Cache Scope -->
  </ee:cache>
</flow>

<flow name="invalidateCompleteCacheFlow">
  <!-- Invalidate Cache component configuration -->
  <ee:invalidate-cache cachingStrategy-ref="myCachingStrategy" />
</flow>

Example: Setting Automatic Invalidation for a Caching Strategy

The following example configures a caching strategy with a custom object store that automatically invalidate cache entries.

<!-- Object Store configuration-->
<os:config name="ObjectStore_Config"/>
<!-- Caching Strategy configuration-->
<ee:object-store-caching-strategy name="Caching_Strategy">
  <!-- Object Store defined for the caching strategy -->
  <os:private-object-store
    alias="CachingStrategy_ObjectStore"
    maxEntries="100"
    entryTtl="10"
    expirationInterval="5"
    config-ref="ObjectStore_Config"/>
</ee:object-store-caching-strategy>