Caching an entire tree

To use page caching for a JSP that forwards request to, or dynamically includes, other JSPs or static files, consider these factors. By default, when you enable page caching for a JSP Web component, only its content is cached. If a JSP includes, or forwards requests to, other pages or static files, their output is not cached. To include the output of all the pages or files that are invoked, you can select to cache a Web component’s entire tree. This example illustrates portions of three JSP files; two use the <jsp:include> tag to include other JSPs:

// page1.jsp
<HTML>
<H1>This is page 1</H1></p>
<jsp:include page="/page2.jsp" />
</HTML>

// page2.jsp
<HTML>
<H2>This is page 2</H2></p>
<jsp:include page="/page3.jsp" />
</HTML>

// page3.jsp
<HTML>
<H3>This is page 3</H3></p>
</HTML>

If you enable page caching for the Web component mapped to page1.jsp and choose to cache the entire tree, the cached entry displays this in the browser:

This is page 1
This is page 2
This is page 3

If you enable page caching for page1.jsp but not for the entire tree, the cached entry displays this in the browser:

This is page 1

When a client requests the Web component mapped to page1.jsp and it is configured to cache the entire tree, the output from page1.jsp, page2.jsp, and page3.jsp is cached as a single entry. EAServer creates a separate cache entry for a single page when:

For example, if the Web component “Page2” is mapped to page2.jsp and it is not configured to cache the entire tree, its output is cached as a separate entry when a client specifically requests Page2.