Configure servlet caching

 

+

Search Tips   |   Advanced Search

 

Overview

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...

Gotcha: If servlet caching checkbox is set to enabled, it will take precendence over all other types of caching, including SITE caching. This means that if servlet caching is enabled, but not configured correctly, you lose all the benefits of servlet caching and obtain none of the benefits of site caching. If servlet caching is not working, to do NOT leave it enabled.

Configure servlet caching to save the output of servlets and JSP files to the dynamic cache.

To enable servlet caching, verify that the dynamic cache service is enabled.

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:

Because JSP files are compiled into servlets, the dynamic cache function treats JSP files the same as servlets, except in specifically documented situations.

 

Procedure

  1. In the console, click...

    Servers | Application servers | server | Web container settings | Web container | Configuration tab | Enable servlet caching

  2. Click Apply or OK.

  3. Restart WAS.

 

What to do next

Define the cache policy for your servlets