<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Smart JavaScript Caching</title>
	<atom:link href="http://www.spiderstrategies.com/blog/?feed=rss2&#038;p=12" rel="self" type="application/rss+xml" />
	<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/</link>
	<description>Notes on Performance Management and writing the software behind it</description>
	<lastBuildDate>Thu, 02 Sep 2010 07:05:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sebastián Streiger</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-23249</link>
		<dc:creator>Sebastián Streiger</dc:creator>
		<pubDate>Thu, 12 Nov 2009 12:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-23249</guid>
		<description>I´ve read all this thread and find it very insteresting.
I´m facing a situation in wich I IE7 is not requesting JS files at all. I verified with fiddler that there were no request for JS files. I´ve solved the problema appending a version number in the request, but I´d like to know if there is a way to avoid this behaviour. If I browse IE temporary files, there are no cached files that match the ones that are not being requested. But if I clear the browser cache the JS files begin to be requested and everithing works fine. 

Best Regards
Sebastián Streiger</description>
		<content:encoded><![CDATA[<p>I´ve read all this thread and find it very insteresting.<br />
I´m facing a situation in wich I IE7 is not requesting JS files at all. I verified with fiddler that there were no request for JS files. I´ve solved the problema appending a version number in the request, but I´d like to know if there is a way to avoid this behaviour. If I browse IE temporary files, there are no cached files that match the ones that are not being requested. But if I clear the browser cache the JS files begin to be requested and everithing works fine. </p>
<p>Best Regards<br />
Sebastián Streiger</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web Caching &#171; Bruno&#8217;s blog</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-12947</link>
		<dc:creator>Web Caching &#171; Bruno&#8217;s blog</dc:creator>
		<pubDate>Thu, 06 Dec 2007 22:58:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-12947</guid>
		<description>[...] Smart JavaScript Caching [...]</description>
		<content:encoded><![CDATA[<p>[...] Smart JavaScript Caching [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-11393</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Thu, 27 Sep 2007 05:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-11393</guid>
		<description>I don&#039;t know what your stack is, but the primary problem I&#039;ve run into is that IE doesn&#039;t respect the server response on an &#039;If-Modified-Since&#039; conditional GET. Even if a new resource is returned with a 200 status, IE decides to &quot;agressively&quot; cache the resource and use cache anyway. IE (and all browsers that I&#039;m aware of) properly handle the &#039;ETag&#039; and &#039;If-None-Match&#039; combination.

I just wrote up our solution tonight @ http://bcarlso.blogspot.com/.

Proper ETag handling has solved the problem for us, enabling us to remove the version number &quot;hack&quot;. One side benefit is that because you are accessing/updating the same URI all the time, your client&#039;s cache doesn&#039;t keep growing and growing.

Thanks!
Brandon</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know what your stack is, but the primary problem I&#8217;ve run into is that IE doesn&#8217;t respect the server response on an &#8216;If-Modified-Since&#8217; conditional GET. Even if a new resource is returned with a 200 status, IE decides to &#8220;agressively&#8221; cache the resource and use cache anyway. IE (and all browsers that I&#8217;m aware of) properly handle the &#8216;ETag&#8217; and &#8216;If-None-Match&#8217; combination.</p>
<p>I just wrote up our solution tonight @ <a href="http://bcarlso.blogspot.com/" rel="nofollow">http://bcarlso.blogspot.com/</a>.</p>
<p>Proper ETag handling has solved the problem for us, enabling us to remove the version number &#8220;hack&#8221;. One side benefit is that because you are accessing/updating the same URI all the time, your client&#8217;s cache doesn&#8217;t keep growing and growing.</p>
<p>Thanks!<br />
Brandon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-10147</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 12 Sep 2007 16:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-10147</guid>
		<description>Good point Michael.  One thing we forgot to mention in this post is that for this technique to work all the time, you need to make sure you are serving up all your HTML pages with special HTTP response headers that tell the browser not to cache the page.  In Java you do that like this:

response.setHeader(&quot;Pragma&quot;, &quot;no-cache&quot;);
response.setHeader(&quot;Cache-Control&quot;, &quot;no-cache&quot;);

which adds this to the beginning of the HTTP response:

Pragma: no-cache
Cache-Control: no-cache

It&#039;s a rather fine distinction, so let me summarize again when to use these 2 different techniques.  For dynamically generated content, you always want to make sure you add the no-cache directives that I posted above.  Otherwise, your user might end up viewing stale data.  The redownloadToken technique is for static resources that you do want to be cached, but which also need to be re-downloaded when a new version of your website is published.</description>
		<content:encoded><![CDATA[<p>Good point Michael.  One thing we forgot to mention in this post is that for this technique to work all the time, you need to make sure you are serving up all your HTML pages with special HTTP response headers that tell the browser not to cache the page.  In Java you do that like this:</p>
<p>response.setHeader(&#8220;Pragma&#8221;, &#8220;no-cache&#8221;);<br />
response.setHeader(&#8220;Cache-Control&#8221;, &#8220;no-cache&#8221;);</p>
<p>which adds this to the beginning of the HTTP response:</p>
<p>Pragma: no-cache<br />
Cache-Control: no-cache</p>
<p>It&#8217;s a rather fine distinction, so let me summarize again when to use these 2 different techniques.  For dynamically generated content, you always want to make sure you add the no-cache directives that I posted above.  Otherwise, your user might end up viewing stale data.  The redownloadToken technique is for static resources that you do want to be cached, but which also need to be re-downloaded when a new version of your website is published.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Bailey</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-9435</link>
		<dc:creator>Michael Bailey</dc:creator>
		<pubDate>Tue, 04 Sep 2007 14:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-9435</guid>
		<description>All well in fact, until the user&#039;s browser has the HTML page cached and never sees the new value appended to the javascript include.

Browser cache is a rogue beast - firefox is one of the worst (but I like the browser).

I&#039;ve explicitly set my cache size to 0mb, and yet it STILL caches.

IE is pretty bad, since their default is to &quot;Check for new versions Automatically&quot; and the best setting is &quot;Every visit to this page&quot;</description>
		<content:encoded><![CDATA[<p>All well in fact, until the user&#8217;s browser has the HTML page cached and never sees the new value appended to the javascript include.</p>
<p>Browser cache is a rogue beast &#8211; firefox is one of the worst (but I like the browser).</p>
<p>I&#8217;ve explicitly set my cache size to 0mb, and yet it STILL caches.</p>
<p>IE is pretty bad, since their default is to &#8220;Check for new versions Automatically&#8221; and the best setting is &#8220;Every visit to this page&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lourens</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-6617</link>
		<dc:creator>Lourens</dc:creator>
		<pubDate>Wed, 11 Jul 2007 07:18:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-6617</guid>
		<description>Thank you for a simple solution to a problem that has baffled me for a long time.</description>
		<content:encoded><![CDATA[<p>Thank you for a simple solution to a problem that has baffled me for a long time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-21</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 13 Feb 2007 16:39:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-21</guid>
		<description>All this means is that the browser sees myfile.js?x=2 as a different file than myfile.js?x=3, even though they&#039;re both just downloading the myfile.js file.  By changing the stuff after the ? we can force the browser to download the file again.  Because of that we can tell the browser to cache the file forever and then change what follows the ? whenever we modify the javascript.</description>
		<content:encoded><![CDATA[<p>All this means is that the browser sees myfile.js?x=2 as a different file than myfile.js?x=3, even though they&#8217;re both just downloading the myfile.js file.  By changing the stuff after the ? we can force the browser to download the file again.  Because of that we can tell the browser to cache the file forever and then change what follows the ? whenever we modify the javascript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Les</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-20</link>
		<dc:creator>Les</dc:creator>
		<pubDate>Tue, 13 Feb 2007 13:39:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-20</guid>
		<description>Excuse my ignorance, but how does the query string to the js work?  What is doing the version comparison, etc?</description>
		<content:encoded><![CDATA[<p>Excuse my ignorance, but how does the query string to the js work?  What is doing the version comparison, etc?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ejboy</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-19</link>
		<dc:creator>ejboy</dc:creator>
		<pubDate>Tue, 13 Feb 2007 08:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-19</guid>
		<description>To Fred:
This cannot be completely automated, nevertheless we have a magic service which returns the current build number (which is repository version in our case):
ServerInfoService.getBuildNumber(); 
For more details see the following example: http://snippets.dzone.com/posts/show/3507</description>
		<content:encoded><![CDATA[<p>To Fred:<br />
This cannot be completely automated, nevertheless we have a magic service which returns the current build number (which is repository version in our case):<br />
ServerInfoService.getBuildNumber();<br />
For more details see the following example: <a href="http://snippets.dzone.com/posts/show/3507" rel="nofollow">http://snippets.dzone.com/posts/show/3507</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://www.spiderstrategies.com/blog/index.php/2007/02/smart-javascript-caching/comment-page-1/#comment-17</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Mon, 12 Feb 2007 21:46:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.spiderstrategies.com/blog/?p=12#comment-17</guid>
		<description>This is really cool.  I&#039;m a CVS survivor, not an expert.  Is there a straight forward way to force the version number into the file automatically?  Or do you just edit the file?</description>
		<content:encoded><![CDATA[<p>This is really cool.  I&#8217;m a CVS survivor, not an expert.  Is there a straight forward way to force the version number into the file automatically?  Or do you just edit the file?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
