After a portlet is invoked and completes generating the output
to cache, a cache entry is created, containing the output and the side effects
of the portlet. These side effects can include calls to other portlets or
metadata about the entry, including timeout and entry priority information.
Configure portlet fragment caching with the WebSphere® Application Sever administrative
console to save the output of portlets to the dynamic cache.
Before you begin
To enable portlet fragment caching, you must complete the steps in
the Using the dynamic cache service topic.
About this task
Unique entries are distinguished by an ID string that generates
from the PortletRequest object each time the portlet runs. You can then base
portlet fragment caching on:
- Request parameters and attributes
- Session information
- Portlet-specific information, portlet session, portlet window ID, portlet
mode, and portlet window state
Procedure
- In the administrative console, click Servers > Application
servers > server_name > Portlet container settings >
Portlet container in the administrative console navigation tree.
- Select Enable portlet fragment cache under the Configuration
tab.
- Click Apply or OK.
- Restart WebSphere Application Server.
Refer
to the Managing application servers topic for more information about managing
your application servers.
What to do next
Define a cache policy for your portlets. Note that portlets are not
cached unless an applicable caching policy is defined in a cachespec.xml file.
Refer to the Configuring cacheable objects with the cachespec.xml file topic
for general task information about defining a cache policy. Refer to the Configuring
caching policies for portlets topic for information about defining portlet-specific
aspects in a cache policy.