Specify caching timeout

 

+
Search Tips   |   Advanced Search

 

IBM WebSphere Portal supports a feature called the display cache, which uses the IBM WAS dynamic cache feature to store portlet output for a specified time before it expires. Requests for that portlet during that time frame draw the content from the cache instead of from the portlet. Display caching is enabled on a portlet-by-portlet basis through an entry in the portlet.xml file. Display caching in the portal is enabled through WebSphere Portal 's Web Container Service. You enable it going to...

WebSphere Application Server Administration Console | Application servers | WebSphere_Portal | Web container

...and checking...

Enable servlet caching

Since each Web clipping portlet instance is a clone of a concrete portlet and since caching is typically enabled per concrete portlet instance, normally all Web clipping portlets would inherit the caching setting. This would not be acceptable if you want caching enabled for some, but not all, Web clipping portlets. To get around this, we can specify a CacheTimeout configuration parameter for a specific portlet. If the display cache is enabled for the portal, and if this value is set in a particular Web clipping portlet, the Web clipping portlet will have its output cached for the specified period of seconds.

So, if a Web clipping portlet is rendered on a page and another page is accessed before returning to this page, all within the specified timeout, portal will pull the Web clipping portlet's output from the display cache instead of invoking the Web clipping portlet again. If the timeout expires or if a link on the Web clipping portlet is selected, then the Web clipping portlet is re-invoked. To specify a caching timeout value, go to...

Administration | Portlet Management | Portlets

Click the Configure portlet icon for the Web Clipping portlet and enter the following information in the New parameter/New value text boxes and then click the Add button:

CacheTimeout = ##


Where ## is some number of seconds. This parameter has no effect if the display cache is not enabled for the portal.

By default, cached contents for Web clipping portlets are shared across all Web clipping portlets. If more than one portlet navigates different content from the same URL, then one can return the content that was cached by another. If this is the case, the clipped content is duplicated across the portlets. To prevent this problem, qualify that the cache entry is portlet instance-specific by adding the following configuration parameter:

CacheKeys = portlet 
Optionally, we can also qualify that the cache entries should be specific to each user by adding the following configuration parameter:

CacheKeys = portlet,user 

 

Related information

 

Parent topic:

Using Web clipping to import content