- Caching strategy
When you plan a caching strategy for HCL Commerce, considerations such as which pages will be cached, and where they will be cached are important. These decisions are influenced by whether you are caching a local (Transaction) server, or a remote (Store) server. To help with these decisions, consider the following approaches.
- Environment setup
To help prepare your environment, see Enabling the dynamic cache service and servlet caching. The cache monitor application, CacheMonitor.ear, must be installed. WebSphere Application Server provides a Dynamic Cache Monitor application to show cache statistics, Edge Side and disk statistics, cache entries, dependency IDs, and cache policy information. To inspect the contents and behavior of the WebSphere Application Server dynamic cache, install the WebSphere Application Server Dynamic Cache Monitor.
- Configuring the dynamic cache service in cachespec.xml
HCL Commerce uses the cache, which provides both local in-memory caching and remote caching using Redis. The HCL Commerce Cache is configured as the IBM DynaCache dynamic caching service provider, allowing servlet and command caching in the baseCache to be configured in cachespec.xml files.
- Allowing access to encrypted parameters
Cache identifiers are based on non confidential information such as store, language, catalog, category, or product identifiers. These identifiers are typically encrypted in the URL. If the parameters are encrypted, a cache miss would result due to missing parameters for the cache ID.
- Cache identifiers
The dynamic cache service assigns a unique cache ID to every stored object. These IDs are generated using <cache-id> rules defined within <cache-entry> elements. By evaluating various information from the application server request, the service assembles the ID from a sequence of defined <components>.
- Custom request attributes for servlet caching
You can create custom request attributes for servlet caching by adding them to the <map> tag.
- Production environments
Operating HCL Commerce in a production environment introduces complexities. For example, accessing cache entries that have been offloaded from memory introduces overhead associated with reading from and writing to the disk. Invalidating these entries is time consuming. Therefore, it is important to tune the cache using the available properties. By setting these values to the appropriate values, you improve the cache invalidation process.