This blog promotes knowledge sharing through experience and collaboration. For more product information, visit our WebSphere Commerce CSE page. For easier navigation, utilize the Categories to find posts that match your interest.
Invalidating Cache: Using the Cache Monitor
There are several way to invalidate cache within a WebSphere Commerce environment. I would to briefly discuss the use of the Cache Monitor Application. There is a distinct difference in the Cache Monitor provided with WebSphere and the Extended Cache Monitor. The Cache Monitor that is provided in WAS installableApps only shows the servlet type cache instances whereas the Extended Cache Monitor shows the servlet type cache and object type cache instances. You can download the Extended Cache Monitor and install into the WebSphere Application Server.
Installing Extended Cache Monitor:
1 - Once the application has been downloaded, open WebSphere Application Server Administration Console. (if clustered, use the Deployment Manager Admin Console)
2 - Navigate to Applications -> New Applications and Choose Enterprise Application and select the cachemonitor.war that was downloaded.
3 - You can take the defaults throughout the installation. I normally just use the virtual host 'default_host'.
4 - Once installed and started, you can access the Cache Monitor by using url ' http://servername:9060/cachemonitor' (port will be defined by virtualhost that was chosen during installation.)
Using Cache Monitor:
There are some advantages and disadvantages to manually invalidating cache with the Cache Monitor. One of the advantages of using this tool is that it allows you to invalidate all cache entries or individual cache entries. Being able to clear them at the same time can be useful at times, but you must be aware that it can impact the performance of a site. One of the problems most customer's face is that with a large number of cache entries, it can be difficult to find specific entries as there is no search function.
As you start to navigate the application, utilize the drop down to view the different cache instances available.
Once you have selected the cache instance to view, there are several views into the cache entries. Notice that you can invalidate each individual entry or you can just hit the clear cache to clear them all. One view of the cache entries by dependency id which allows you to group the entries based on the id. Example below
One of the more useful views in Cache Monitor is the ability to view the cache contents. This can give you good idea of what is being cached. Here is an example of the baseCace:
The Extended Cache Monitor is a useful tool that allows you to manually invalidate single cache entries or all cache entries within an instance. I find this tool extremely useful when troubleshooting issue related to cache. The biggest advantage to using it is there is no waiting for a scheduled job or a specific amount of time to invalidate the cache.