The /atg/commerce/endeca/cache/DimensionValueCacheTools
component (of class atg.commerce.endeca.cache.DimensionValueCacheTools
) provides methods used to access the caches. These include methods for:
Retrieving a
List
ofDimensionValueCacheObject
instances that correspond to a particular category ID.Retrieving the
DimensionValueCacheObject
associated with a particular dimension value ID.Creating a new cache.
Refreshing an existing cache.
In an environment with multiple MDEX engines, a single DimensionValueCacheTools
component performs these operations on all caches. DimensionValueCacheTools
has a getCache()
method which retrieves the appropriate cache to access for a given request, based on the value returned by the getCurrentApplicationKey()
method of the AssemblerApplicationConfiguration
component.
Populating and Refreshing the Cache
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.minimumCacheRefreshIntervalSecs
property (default value is 600).A refresh is already in progress.
The MDEX has not been updated since the last time the cache was refreshed.
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
TheDimensionValueCacheTools
component used to access the cache. Set by default to/atg/commerce/endeca/cache/DimensionValueCacheTools
.
navigationState
The component representing the EndecaNavigationState
to use to access the MDEX. By default, this is set to the/atg/endeca/assembler/cartridge/manager/UnfilteredNavigationState
component, which creates aNavigationState
object 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.