Enable Browser Caching for Tomcat’s Deliveries

Tomcat automatically adds “no-cache” directives to each response. This is not a good idea when you are not using Apache as the serving host for static content. I found a very easy way to get rid of that HTTP header. Just add a new file named “context.xml” to the WEB-INF directory of your application:

1
2
3
4
<context>
	<valve className="org.apache.catalina.authenticator.BasicAuthenticator"  
		disableProxyCaching="false" />
</context>

For finer control, please have a look at Symphonious’ article on that topic.

Tags: ,

2 Responses to “Enable Browser Caching for Tomcat’s Deliveries”

  1. Omer Says:

    Hi Ralph,

    I had been looking for just the solution you have above.

    Thanks a Zillion for the post.

    It made my task simple.

    Regards
    Omer

  2. American Steroids Online Says:

    […] with Bitcoins Buy American Steroids Online with Bitcoins Buy American Steroids Online with Bitcoins Buy American Steroids Online with Bitcoins Buy American Steroids Online with Bitcoins Buy American Steroids Online with Bitcoins Buy American […]

Leave a Reply