Tutorials > Dynamic caching > Accept cache identifiers
Add WebSphere Commerce DC_RequestAttributes
A servlet filter known as the cache filter enables the dynamic cache to use session information to construct the cache ID. The cache filter is designed to set up request attributes from the session data, MemberGroupsCacheCmd, and store relationship information. Dynamic cache can use the request attributes as component elements.
To access these components, set the type of the component to attribute and the value set to one of the defined DC values.
In the example, we will add a component to the cache-id for TopCategoryDisplay that references the value for currency set in the request attribute, DC_curr.
Procedure
- Add a component for DC_curr to the TopCategoriesDisplay page.
- Open the cachespec.xml file located at WC_EAR\Stores.war\WEB-INF.
- Add the following component to the <cache-id> for the TopCategoriesDisplay page:
<component type="attribute"> <required>true</required> </component>
- Test the cachespec.xml.
- Use the cache monitor, look at the cache policies to verify that DC_curr is a required component of the cache-id.
- Use the cache monitor to clear the entries from the cache.
- Hit the TopCategoriesDisplay page.
- Look at the cached entries in the cache monitor. There should be an entry for the TopCategoriesDisplay page. You should see the DC_curr value in the id .