Dynamic caching

This topic describes the dynamic caching of WebSphere Commerce servlet or JavaServer Pages (JSP) results.

WebSphere Commerce servlet or JSP result caching

When a customer clicks a link to view a product or category page, most of the time is spent parsing the HTTP request, accessing the database, and dynamically creating the page. Heavy site traffic and many product and category entries in the database can further increase the time it takes for servlets or JavaServer Pages (JSP files) to load.

Most HTTP requests on the server will be for catalog information. The WebSphere Commerce commands -- CategoryDisplay, ProductDisplay, TopCategoriesDisplay, and StoreCatalogDisplay -- retrieve information from your database, and display the result as a JSP page. If the catalog information has not changed since it was last viewed, the servlet or JSP file does not need to be re-executed the next time a customer requests it. Serving an equivalent static servlet or JSP file stored in a cache would be faster. Caching of the servlet or JSP can be constructed by defining cache-entry elements in the cachespec.xml file located in the WEB-INF directory of the Web module.

If the cache entry corresponding to the page being accessed is not in memory, it will be generated dynamically. The page is then stored to memory, and will not have to be regenerated until the data it is based on is modified.

Note: WebSphere Commerce dynamic caching and URL rewriting cannot interoperate. With URL rewriting turned on, you need to disable WebSphere Commerce dynamic caching and you should not cache your servlet or JSP files. For more information URL rewriting, see Session management.

WebSphere Application Server dynamic cache

WebSphere Commerce utilizes the WebSphere Application Server dynamic cache service for caching servlets or JSP files and commands that extend from the WebSphere Application Server CacheableCommand interface. The dynamic cache service, servlet caching and disk offload are enabled by default, during the creation of a WebSphere Commerce instance.

For more information on the WebSphere Application Server dynamic cache, refer to the topic "Using the dynamic cache service to improve performance" in the WebSphere Application Server Information Center.

Dynamic cache

Caching the servlet or JSP file results improves application performance. WebSphere Application Server consolidates several caching activities, including servlets, Web services, and WebSphere commands into one service called the dynamic cache. These caching activities work together to improve application performance, and share many configuration parameters, which are set in an application server's dynamic cache service.

You can use the dynamic cache to improve the performance of servlet and JSP files by serving requests from an in-memory cache. Cache entries contain servlet output, results of servlet execution, and metadata.

For more information, see the topic "Using the dynamic cache service to improve performance" in the WebSphere Application Server Information Center.

Enabling the dynamic cache service and servlet caching

To enable caching, you should enable the dynamic cache service and configure servlet caching. For information to perform these steps, see the topics "Enabling the dynamic cache service" and "Configuring servlet caching" in the WebSphere Application Server Information Center.

Enabling the Dynamic Cache Monitor

WebSphere Application Server provides a Dynamic Cache Monitor application for displaying cache statistics, Edge Side and disk statistics, cache entries, dependency IDs, and cache policy information. In order to inspect the contents and behavior of the WebSphere Application Server dynamic cache, you should install the WebSphere Application Server Dynamic Cache Monitor. To use the Dynamic Cache Monitor, install the CacheMonitor.ear file, located in the installableApps subdirectory under the WAS_installdir directory, on each application server that uses dynamic caching.

For WebSphere Commerce, it is recommended that you use the virtual host VH_instance_name_admin (for example, VH_demo_admin) instead of VH_instance_name for the Dynamic Cache Monitor, for security reasons. You can add or change virtual host names from the WebSphere Application Server Administrative Console.

You can access the Web application using a Web browser with the following Web address:

http://host_name:port/cachemonitor

However, for a more secure access, it is recommended that you access the Administration host machine:

https://admin_host_name:port/cachemonitor

For example, if the virtual host VH_instance_name_admin is used for installing the Cache Monitor, then the Cache Monitor can be accessed as:

https://admin_host_name:8002/cachemonitor
Notes:
  1. You need to launch one dynamic cache monitor for every WebSphere Commerce instance.
  2. Whenever you want to use the Cache Monitor and you have WebSphere Application Server EJB security enabled, you will need to perform some additional set up as documented in Security configuration for the Dynamic Cache Monitor.

For more information on installing the Dynamic Cache Monitor see the topic "Displaying cache information" in the WebSphere Application Server Information Center.

Tree View for Dependency IDs for WebSphere Dynamic Cache Monitor

WebSphere Commerce provides a Tree View tool, an extension of the Cache Monitor, which provides a tree view of the dependency ID in memory. The Tree View tool provides a tree view of the dependency ID. You can expand or collapse any tree node to get a hierarchical view, as well as invalidate a cache entries group under that node. The original view will be untouched instead a new link will appear as "Dependency IDs Tree View".

For information on installing and using the Tree View tool, see the README file for the "Tree View for Dependency IDs for WebSphere Dynamic Cache Monitor" located in the following directory:

Feedback