Set up command caching for catalog filter
If the site uses catalog filters, we can set up command caching for catalog filter to help improve site performance.Cacheable commands can eliminate much of the processor usage associated with running redundant database queries. Command Caching eliminates this usage by storing the results from earlier queries in a cache. With the WebSphere Commerce search feature enabled, catalog filter commands can compose search expressions to perform entitlement for users under different trading agreements. By adding command caching for catalog filters, the filtering search expression can be retrieved from the cache entry instead of from the database. This cache entry retrieval can improve response time and reduce system load.
Before beginning
Ensure that we are familiar with and understand the methods used to generate a key that is described in the following topic:
Task info
When you set up caching for catalog filter, we can add cache entries for the following catalog filter-related commands:
- ResolveCatalogFilterSolrExpressionCmdImpl
- This command accelerates the catalog filter-related entitlement check procedure. If the site uses WebSphere Commerce search and the Management Center catalog filter functionality, caching entries for this command can improve search performance. Caching entries for this command can also improve add to cart performance that performs entitlement checks before the process adds a product to a shopping cart.
- ScheduledCatalogFilterImportCmdImpl
- This command is a schedule command to import catalog filters with the Catalog Filter and Pricing tool or the Data Load utility. This command is triggered if the site imports catalog filter data into Management Center. The caching entry for this command is used to declare invalidation against catalog filters that are imported into Management Center with the Data Load utility or the Catalog Filter and Pricing tool. With this declaration all the cache entries for catalog filter commands are invalidated.
- CalculateProductSetEntitlementCmdImpl
- This command accelerates calculating entitlement check for product sets. Caching entries for this command can improve performance if the site uses WebSphere Commerce Accelerator product set based catalog filtering and not Management Center catalog filtering.
Procedure
- Open the sample cache configuration file cachespec.xml in the following directory:
- WCDE_installdir/samples/dynacache/Contract
- Copy all the cache entries from this sample cache configuration file.
- Open the cachespec.xml file that is found in the following directory:
- workspace_dir/Stores/WebContent/WEB-INF/
- Paste the cache entries from the sample cache configuration file to this cachespec.xml file.
- Save and close the cachespec.xml file.
Related concepts
Dynamic caching
Related reference
Commands and methods for generating a cache key