Develop > Presentation layer > WebSphere Commerce integration with WebSphere Portal > WebSphere Commerce Portal caching
Enable existing JSR 168 portlet JSP files for JSP caching
To illustrate the usage of the cache tag on a JSP file, a WebSphere Commerce portlet JSP file is used as an example to demonstrate how you can replace WebSphere Portal's Portlet Caching configuration with this JSP file Caching.
Before you begin:
- Enable Servlet Caching on the WebSphere Portal server.
- Install Cache Monitor to the WebSphere Portal server so that you can have a real time view of the current state of DynaCache.
- Install and configure the WebSphere Commerce portlet samples.
- Create a sample WebSphere Commerce portal site.
A sample JSP file called ProductDisplay.jsp is used in a WebSphere Commerce MVCPortlet. This JSP file is a portlet JSP file that displays a WebSphere Commerce product in a simple layout where the name, description and an image of the product is found. On this page fragment, there is also a button which represents the submit action of an underlying HTML form for adding the current product item to the user's shopping cart.
- Configure the ProductDisplay JSP file for JSP Caching
Because Portlet Caching uses DynaCache underneath, it is recommended to disable Portlet Caching while using JSP Caching. If both of these caching techniques are used at the same time, you are going to have two versions of the same cached content for each cacheable portlet JSP.
- Inspect the ProductDisplay cache content in DynaCache
Once the cache configuration is completed, we can now test out the cache policy by accessing the Product portlet with two different users.
- Excluding information from ProductDisplay cache content
Although the ProductDisplay content should cached and shared with all types of users, there could be situations where certain part of the cached content may be sensitive to some properties of that current user.