The /atg/endeca/assembler/cartridge/handler/DimensionValueCacheRefresh component (of class atg.commerce.endeca.assembler.cartridge.handler.DimensionValueCacheRefreshHandler) is responsible for accessing the MDEX to populate the associated cache. If an attempt is made to access a cache that does not exist, the DimensionValueCacheTools.createEmptyCache() method is invoked to create an empty DimensionValueCache. The DimensionValueCacheRefresh component then accesses the MDEX to populate the cache. For each dimension value of the specified dimension, DimensionValueCacheRefresh creates a new DimensionValueCacheObject that stores the dimension value ID, the repository ID, the URL, and the repository IDs of the item’s ancestor items.
If a cache lookup fails to find an entry, this may be because the cache is out of date. When this happens, DimensionValueCacheRefresh attempts to refresh the cache by recreating all of the entries. However, to prevent unnecessary refreshes (such as when an entry is not found because it has not been indexed, which means a refresh will not fix the failed lookup), the cache is not refreshed if any of the following conditions exist:
The number of seconds since the last refresh is less than the value of the
DimensionValueCacheTools.minimumCacheRefreshIntervalSecsproperty (default value is 600).A refresh is already in progress.
The MDEX has not been updated since the last time the cache was refreshed.
To ensure that the caches do not become stale, DimensionValueCacheTools has a property, checkMDEXUpdatedEveryNHours, for specifying a time interval in hours. (The default value is 24.) When an attempt is made to access a cache, if the number of hours since the last refresh of the cache is greater than this value, DimensionValueCacheRefresh attempts to refresh the cache. However, the cache is not refreshed if any of the conditions listed above exist.
Key properties of the DimensionValueCacheRefresh component include:
dimensionName
The name of the dimension in the MDEX. Set by default toproduct.category.
repositoryIdProperty
The name of the property in the MDEX that represents the repository ID of the category. Set by default tocategory.repositoryId.
dimensionValueCacheTools
TheDimensionValueCacheToolscomponent used to access the cache. Set by default to/atg/commerce/endeca/cache/DimensionValueCacheTools.
navigationState
The component representing the Guided SearchNavigationStateto use to access the MDEX. By default, this is set to the/atg/endeca/assembler/cartridge/manager/UnfilteredNavigationStatecomponent, which creates aNavigationStateobject without any refinements or filters applied. This is done so that the set of dimension values returned is not restricted based on the navigational context.
Populating the DimensionValueCacheObject.url Property
To populate the url property of a DimensionValueCacheObject with an appropriate link, the DimensionValueCacheTools component invokes the Assembler. These links must always begin with the /browse content path and, as such, they require the DimensionValueCacheTools component to perform an extra step. Specifically, before the invocation, the DimensionValueCacheTools component modifies the request it passes to the Assembler to add a new request attribute, DefaultActionPathProvider.ALWAYS_USE_DEFAULT_NAVIGATION_CONTENT_PATH, and sets it to true. This request attribute forces the Assembler to use the DefaultActionPathProvider component’s defaultExperienceManagerNavigationActionPath property when setting the content path for the url, instead of going through the normal DefaultActionPathProvider calculations to derive the content path. Because this property is set to /browse by default, forcing the Assembler to use it ensures that the links returned to the DimensionValueCacheTools component are correct. The DimensionValueCacheTools object subsequently removes the additional request attribute after the links are retrieved, so any other invocations of the Assembler proceed as normal.
Note: For more details on Assembler invocation and the DefaultActionPathProvider component, see the Query Integration chapter.

