WebSphere Commerce Search caching

WebSphere Commerce Search uses fragment caching in the storefront. Notes:

For a fragment to be cacheable, it must be self-executable. Each dynamically included JSP file must contain its own <cache-entry> defined in the cachespec.xml file. This <cache-entry> is required to have the JSP file served up by the dynamic cache when it receives a request. Otherwise, each dynamically included JSP file is re-executed for each request. For example, if StoreCatalogDisplay.jsp dynamically includes CachedHeaderDisplay.jsp, CachedFooterDisplay.jsp and CachedStoreCatalogDisplay.jsp and you only set up a <cache-entry> for the CachedStoreCatalogDisplay.jsp. Then, when you request the StoreCatalogDisplay page, the CachedStoreCatalogDisplay.jsp, CachedHeaderDisplay.jsp, and CachedFooterDisplay.jsp files are executed if they are not cached.


Catalog filter caching

If the site uses catalog filters, ensure that catalog filter caching is enabled.


Cache invalidation

When the search index is updated, the search related cache entries must be invalidated using the Dynacache API. WebSphere Application Server dynamic caching provides the following APIs to support programmatic invalidation:

WebSphere Commerce also provides a DynaCacheInvalidation command, which is called by the scheduler periodically to process the records in the CACHEIVL table. It then calls the WebSphere Application Server dynamic cache invalidation APIs to invalidate the specified cache entries. By default, the schedule interval is every 10 minutes. For more information about this invalidation process, seeCache invalidation.


Caching considerations for WebSphere Commerce Search

We can use fragment caching for WebSphere Commerce Search results. However, we must practice caution to ensure that your caching strategy performs well. At a minimum, we must test your caching strategies before publishing the store to production.

In addition to using DynaCache in the WebSphere Commerce server and caching some of the relatively static search data, such as auto-suggested search entries, we can use the WebSphere Commerce search server to cache index data in memory. The size of the index cache pools must be configured based on the memory heap size that is allocated for the search server.