I found what was interfering with the caching: it's sitemesh. I have this filter-mapping:


If I remove that, it works fine. Once I found that, I realized that adding the page pattern to the sitemesh exclude list solves the problem. I don't understand what/how sitemesh is doing to the page to make it uncacheable, but that's a different issue.


Kimberly Nicholls wrote:

I am having trouble getting the "Included Pages" example from http://www.caucho.com/resin-3.0/performance/caching.xtp to work. I am running Resin 3.0.22 Professional on Mac OS 10.4.8. I turned on cache logging, then created these files as described on that page:

<%@ page session="false" %>
long now = System.currentTimeMillis();
response.setHeader("Cache-Control", "public");
response.setDateHeader("Expires", now+(5*60*1000));
now=<%= now %>

<%@ page session="true" %>
this is test.jsp
<jsp:include page="expires.jsp" />

I loaded expires.jsp via wget. The headers have Cache-Control: public and Expires: Tue, 30 Jan 2007 17:23:59 GMT, and the cache log says caching: /test/expires.jsp expires=Tue, 30 Jan 2007 17:23:59 GMT length=20. I used wget to load test.jsp, but it doesn't use the cached expires.jsp. It doesn't cache it again either -- there's nothing in the cache log at all. I loaded expires.jsp immediately after, and it again used the cache.

One thing I noticed is that when I load expires.jsp, the log says it's creating a session even though I have session="false". I tried checking the value of session in expires.jsp, and as I'd expect, got a compile error for undefined symbol.

I also tried restarting resin and repeating the same sequence using Firefox, setting response.addHeader("Cache-Control", "max-age=300") instead of the Expires header, changing the include path to be absolute (/test/expires.jsp), and setting Last-Modified instead of Expires and adding the path to the cache-mapping section in resin.conf. What am I missing?

Thanks for your help,
Kimberly Nicholls

resin-interest mailing list

Reply via email to