Home


Dependency identifiers

The dependency identifier is the key to configuring invalidation in the cachespec.xml. The dependency identifier <dependency-id> is defined after the <cache-id> element within the <cache-entry> element. A sample dependency identifier is shown in Example | -1.

Example 3-1 Sample dependency identifier

<cache-entry>
  <class>servlet</class>
  <name>/ConsumerDirect/include/styles/style1/CachedHeaderDisplay.jsp</name>

  <property name="do-not-consume">true</property>
  <property name="save-attributes">false</property>

  <cache-id>
    <component  id="storeId" type="parameter">
      <required>true</required>
    </component>
    <component  id="catalogId" type="parameter">
      <required>true</required>
    </component>
    <component  id="DC_userType" type="attribute">
      <required>false</required>
      <not-value>-1002</not-value>
    </component>
    <component  id="DC_lang" type="attribute">
      <required>true</required>
    </component>
  </cache-id>

  <dependency-id>storeIdPages
    <component id="storeId" type="parameter">
      <required>true</required>
    </component>
  </dependency-id>

The dependency ID is a label that is used to identify which cache entries to invalidate. The same label may be attached to one, or more than one, cache entry, creating a group of cache entries. It is used in an invalidation rule to invalidate a whole group of entries.

In Example | -1, the dependency ID base string name is storeIdPages. In the cache ID, the component sub-elements have component ID values. The invalidation rule compares the component IDs with the dependency ID to identify cache entries to invalidate. In the example, the component ID storeId matches the dependency ID storeIdPages. The type attribute specifies that storeId is a request parameter.

The value of the dependency-id element is generated by concatenating the dependency ID base string with the values that are returned by its component elements. An example of a dependency ID is:

storeIdPages:storeId:10001

Each cache entry may have multiple dependency IDs with one or more component identifiers.

The <require> sub element indicates that storeId must have a value. If a required component returns a null value, the entire dependency does not generate and is not used.

In summary, dependency IDs label cache entries and are used by invalidation rules to invalidate one or more cache entries at a time. Dependency IDs and invalidation rules are defined in cachespec.xml. Figure | -1shows a high-level view of how two invalidation rules affect cache entries defined in the cachespec.xml. These rules invalidate cache objects defined by the first cache entry (dotted line) or cache objects defined by the second cache entry (solid line) when their full dependency ID strings match. Note that in the cachespec.xml, only the dependency ID base string is shown. This string is part of the dependency ID but does not represent the full dependency ID.

Figure 3-1 Dependency ID: Invalidation rule relationship

In the following section, we describe how to define invalidation policies and how dependency IDs are used by those invalidation policies to invalidate cache entries in the cachespec.xml.

+

Search Tips   |   Advanced Search