<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ralph's TechBlog &#187; caching</title>
	<atom:link href="http://techblog.ralph-schuster.eu/tag/caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.ralph-schuster.eu</link>
	<description>Technical stuff for IT experts</description>
	<lastBuildDate>Tue, 27 Dec 2011 09:38:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Enable Browser Caching for Tomcat&#8217;s Deliveries</title>
		<link>http://techblog.ralph-schuster.eu/2008/02/19/enable-browser-caching-for-tomcats-deliveries/</link>
		<comments>http://techblog.ralph-schuster.eu/2008/02/19/enable-browser-caching-for-tomcats-deliveries/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 10:55:13 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[no-cache]]></category>

		<guid isPermaLink="false">http://techblog.ralph-schuster.eu/2008/02/19/enable-browser-caching-for-tomcats-deliveries/</guid>
		<description><![CDATA[Tomcat automatically adds &#8220;no-cache&#8221; 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 &#8220;context.xml&#8221; to the WEB-INF directory of your application: 1 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.ralph-schuster.eu%2F2008%2F02%2F19%2Fenable-browser-caching-for-tomcats-deliveries%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.ralph-schuster.eu%2F2008%2F02%2F19%2Fenable-browser-caching-for-tomcats-deliveries%2F&amp;source=TechnicalG&amp;style=compact&amp;hashtags=caching,no-cache&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Tomcat automatically adds &#8220;no-cache&#8221; 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 &#8220;context.xml&#8221; to the WEB-INF directory of your application:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;valve</span> <span style="color: #000066;">className</span>=<span style="color: #ff0000;">&quot;org.apache.catalina.authenticator.BasicAuthenticator&quot;</span>  </span>
<span style="color: #009900;">		<span style="color: #000066;">disableProxyCaching</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/context<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>For finer control, please have a look at <a href="http://www.symphonious.net/2007/06/19/caching-in-tomcat/" title="Symphonious' article">Symphonious&#8217; article</a> on that topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ralph-schuster.eu/2008/02/19/enable-browser-caching-for-tomcats-deliveries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

