Next >
Tutorial: Improve WebSphere Commerce performance with dynamic caching
The tutorial provides hands-on exercises that illustrate several basic dynamic caching (dynacache) tasks in WebSphere Commerce to improve performance. It shows you how to overcome problems commonly encountered with dynacache, and demonstrates helpful tips and tricks.
Learning objectives
Upon completion of this tutorial, you should be able to:
- Cache a full-page and a page fragment.
- Invalidate cache-entries using a variety of techniques.
- Build cache-ids from different components.
- Use the dynacache APIs not to cache.
- Cache full-page and page fragments on the edge.
- Understand the additional requirements to cache in a production environment.
Time required
Expect this tutorial to take about 6 hours to complete.
Audience
This tutorial is intended for WebSphere Commerce Administrators who will be responsible for improving store performance.
Expected results
In this tutorial, you learned to improve WebSphere Commerce performance with dynamic caching using the following steps:
- You prepared your environment by adding a cache-entry to your cachespec.xml and updating your server's refresh interval.
- You modified your cachespec.xml file to cache a fragment and then observed the problems caused when a fragment is not executable on its own. You modified the fragment to be executed independently from the parent page.
- You invalidated cache entries using one of the five invalidation techniques: timeout, command invalidation, CacheIVL table, Dynacache API, or dependency trees.
- You build the cache entries using one of the four methods: WebSphere Commerce session attributes, WAS session attributes, cookies or CommandContext method calls.
- You programmatically prevented pages and fragments from being cached, even when the cachespec.xml file indicated that they should be.
- You learned how to cache pages on the edge of the network using ESI caching for both full page and fragment caching.
- You learned how to improve the performance of the dynacache's disk offload capabilities by using the following properties:
- com.ibm.ws.cache.CacheConfig.htodDelayOffloadEntriesLimit
- com.ibm.ws.cache.CacheConfig.htodDelayOffload
- com.ibm.ws.cache.CacheConfig.htodDelayOffloadEntriesLimit
- You also learned how to configure Cache Replication in a clustered environment.
Reference
- Sample code used for these tutorials can be downloaded in zip format. The extracted contents of the zip file is sorted first by tutorial number, then by file name.
Lessons in this tutorial
- Tutorial: Setting up the dynamic cache environment
This tutorial teaches you about some WAS settings, and how to prepare a simple cachespec.xml file. After completing this tutorial, you will have your WebSphere configured. You will also have a basic cachespec.xml file setup to full-page cache the store's TopCategoryDisplay page.- Change the refresh interval
WAS has a parameter called the Reload Interval to indicate how frequently a JSP should be recompiled. In our labs, you will modify JSPs and view the changes. To facilitate the changes being reflected immediately, you will shorten the interval to 10 seconds.- Install the cache monitor
The dynamic cache monitor is an installable Web application that displays simple cache statistics, cache entries, and cache policy information.- Tutorial: Installing the ESI cache monitor
To see the Edge Cache statistics using the cache monitor, install the DynaCacheEsi.ear Web application.- Set up the cachespec.xml to full-page cache TopCategoriesDisplay
This section is related to setting up the cachespec.xml to full-page cache TopCategoriesDisplay.