Configuring servlet caching

After a servlet is invoked and completes generating the output to cache, a cache entry is created containing the output and the side effects of the servlet. These side effects can include calls to other servlets or JavaServer Pages (JSP) files or metadata about the entry, including timeout and entry priority information. Configure servlet caching to save the output of servlets and JavaServer Pages (JSP) files to the dynamic cache.

Before you begin

To enable servlet caching, you must complete Enabling the dynamic cache service.

About this task

Unique entries are distinguished by an ID string that is generated from the HttpServletRequest object each time the servlet runs. You can then base servlet caching on:
  • Request parameters and attributes of the Universal Resource Identifier (URI) that was used to invoke the servlet
  • Session information
  • Other options, including cookies
Because JavaServer Pages files are compiled into servlets, the dynamic cache function treats JavaServer Pages files the same as servlets, except in specifically documented situations.

Procedure

  1. In the administrative console, click Servers > Application servers > server_name > Web container settings > Web container in the console navigation tree.
  2. Select Enable servlet caching under the Configuration tab.
  3. Click Apply or OK.
  4. Restart WebSphere Application Server. See Managing application servers for more information.

What to do next

Define the cache policy for your servlets by Configuring cacheable objects with the cachespec.xml file.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 11:08:29 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-mp&topic=tdyn_servletcaching
File name: tdyn_servletcaching.html