Sun Java System Web Server 7.0 Update 4 Performance Tuning, Sizing, and Scaling Guide

Using Servlet/JSP Caching

If you spend a lot of time re-running the same servlet/JSP, you can cache its results and return results out of the cache the next time it is run. This is useful for common queries that all visitors to your site run: you want the results of the query to be dynamic because the results might change daily, but you don't need to run the logic for every user.

To enable caching, you configure the caching parameters in the sun-web.xml file of your application. For more details, see Caching Servlet Results in Sun Java System Web Server 7.0 Update 4 Developer’s Guide to Java Web Applications.