Chris Lott wrote:
Hi,

Summary: Please tell me what headers Tomcat 5.0.28 sets when it serves out a plain file, and how I can control those headers.
..

I found more detail and found a possible solution. I still welcome your comments.

To figure out what headers Tomcat sets in responses, I turned on the RequestDumperValve in the server.xml file. There I saw that every single request -- whether .gif, .html, .css, .ppt, or .jsp -- gets "Cache-Control: no-cache" and "Pragma: no cache" in the response headers. So that answers my first question. (And the Apache sitting in front of Tomcat seems to have no influence here whatsoever.)

A possible solution came from here:
http://www.jspinsider.com/content/dev/afessh/another-filter-every-site-should-have.html
where Jayson Falkner discusses using servlet filters to set response headers so web browsers will cache items like pictures and other static content. I used this approach with some success.

I still have one question and/or a suggestion: it seems that Tomcat needs some configuration setting so users like me can tell the container what caching policy to apply by default. Maybe it exists, but I have not found it. Possibly an enhancement, sort of like a mime-types file, would allow the caching policy to be set based on file suffixes or file-name patterns.

Thanks for listening, and I would sure appreciate guidance if I'm all wet here, or confirmation that I'm on the right path.

chris...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to