8.7. Portlet caching

Caching improves performance by reducing the load on the server. Caching is per user per portlet, a portlet cached for one user will not be used for another user. A JSR 168 portlet must use the portlet.xml to enable caching.

Example 8-19. Portlet caching in the portlet.xml
<portlet>
   ...
      <expiration-cache>600</expiration-cache>
   ...
</portlet>

The expiration cache is defined in seconds. In the example above, the contents of the portlet should be cached for 10 minutes. A value of zero indicates that the portlet caching is disabled. A -1 value will cause the portlet cache to never expire. Any value above 0 will be interpreted as the number of seconds the content should be cached for.

If the expiration-cache is defined in the ...

Get IBM Rational Application Developer V6 Portlet Application Development and Portal Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.