<?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: Automatic asset versioning in Django</title>
	<atom:link href="http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Mon, 21 May 2012 05:48:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stuart Colville</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-65374</link>
		<dc:creator>Stuart Colville</dc:creator>
		<pubDate>Tue, 27 Oct 2009 21:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-65374</guid>
		<description>@Ben: Thanks - I&#039;ve updated the code example</description>
		<content:encoded><![CDATA[<p>@Ben: Thanks &#8211; I&#8217;ve updated the code example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-65366</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 22 Oct 2009 23:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-65366</guid>
		<description>For the regexp substitution, I think you mean:
&lt;code&gt;rx.sub(r&quot;\1.%d.\2&quot; % mtime, path_string)&lt;/code&gt;

Without the raw string you&#039;ll get binary in your return value the dots will be wildcards.

This was a helpful article, though.  Thanks!</description>
		<content:encoded><![CDATA[<p>For the regexp substitution, I think you mean:<br />
<code>rx.sub(r"\1.%d.\2" % mtime, path_string)</code></p>
<p>Without the raw string you&#8217;ll get binary in your return value the dots will be wildcards.</p>
<p>This was a helpful article, though.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Åukasz Korzybski</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64716</link>
		<dc:creator>Åukasz Korzybski</dc:creator>
		<pubDate>Mon, 08 Dec 2008 13:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64716</guid>
		<description>Recently I found this very interesting post, by Steve, about proxy and query strings issues. Steve proved that Squid&#039;s default configuration is not to cache URLs with query strings.

http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

So at the end it seems that using conservative file name versioning is better and more safe than QS method.</description>
		<content:encoded><![CDATA[<p>Recently I found this very interesting post, by Steve, about proxy and query strings issues. Steve proved that Squid&#8217;s default configuration is not to cache URLs with query strings.</p>
<p><a href="http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/" rel="nofollow">http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/</a></p>
<p>So at the end it seems that using conservative file name versioning is better and more safe than QS method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukasz Korzybski</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64389</link>
		<dc:creator>Lukasz Korzybski</dc:creator>
		<pubDate>Tue, 10 Jun 2008 20:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64389</guid>
		<description>Great stuff, thanks a lot :)

One note thought: 

Atually as Steve pointed out in his comment to &lt;a href=&quot;http://developer.yahoo.net/blog/archives/2007/05/high_performanc_2.html&quot; rel=&quot;nofollow&quot;&gt;High Performance Web Sites: Rule 3 - Add an Expires Header&lt;/a&gt; the HTTP 1.1 specs says that URLs with query strings should not be cached only when there is no explicit expiration information:

From HTTP 1.1 spec, section 13.9:
&lt;cite&gt;
e note one exception to this rule: since some applications have
   traditionally used GETs and HEADs with query URLs (those containing a
   &quot;?&quot; in the rel_path part) to perform operations with significant side
   effects, caches MUST NOT treat responses to such URIs as fresh unless
   the server provides an explicit expiration time.
&lt;/cite&gt;

Also, RoR have some kind of template tag for auto versioning and it uses QS as far as I know.

 - Lukasz</description>
		<content:encoded><![CDATA[<p>Great stuff, thanks a lot <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One note thought: </p>
<p>Atually as Steve pointed out in his comment to <a href="http://developer.yahoo.net/blog/archives/2007/05/high_performanc_2.html" rel="nofollow">High Performance Web Sites: Rule 3 &#8211; Add an Expires Header</a> the HTTP 1.1 specs says that URLs with query strings should not be cached only when there is no explicit expiration information:</p>
<p>From HTTP 1.1 spec, section 13.9:<br />
<cite><br />
e note one exception to this rule: since some applications have<br />
   traditionally used GETs and HEADs with query URLs (those containing a<br />
   &#8220;?&#8221; in the rel_path part) to perform operations with significant side<br />
   effects, caches MUST NOT treat responses to such URIs as fresh unless<br />
   the server provides an explicit expiration time.<br />
</cite></p>
<p>Also, RoR have some kind of template tag for auto versioning and it uses QS as far as I know.</p>
<p> &#8211; Lukasz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64293</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Mon, 28 Apr 2008 05:50:58 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64293</guid>
		<description>I was just looking around for some background to write something just like this for Django!

Thanks very much for saving me several hours!

- rich</description>
		<content:encoded><![CDATA[<p>I was just looking around for some background to write something just like this for Django!</p>
<p>Thanks very much for saving me several hours!</p>
<p>- rich</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Bruniges</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64229</link>
		<dc:creator>Ross Bruniges</dc:creator>
		<pubDate>Thu, 10 Apr 2008 07:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64229</guid>
		<description>I have a feeling that this will provide very very useful to a number of people :&gt;</description>
		<content:encoded><![CDATA[<p>I have a feeling that this will provide very very useful to a number of people :&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Colville</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64215</link>
		<dc:creator>Stuart Colville</dc:creator>
		<pubDate>Tue, 08 Apr 2008 10:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64215</guid>
		<description>@Brad: Excellent points well made. I&#039;ve updated the script accordingly.</description>
		<content:encoded><![CDATA[<p>@Brad: Excellent points well made. I&#8217;ve updated the script accordingly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Wright</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64212</link>
		<dc:creator>Brad Wright</dc:creator>
		<pubDate>Tue, 08 Apr 2008 08:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64212</guid>
		<description>Oops, my mod_rewrite had fail:

&lt;code&gt;RewriteRule ^/static/([a-z-]+)\.[0-9]+\.(css&#124;js) /static/$1\.$2 [L]&lt;/code&gt;

Is better.</description>
		<content:encoded><![CDATA[<p>Oops, my mod_rewrite had fail:</p>
<p><code>RewriteRule ^/static/([a-z-]+)\.[0-9]+\.(css|js) /static/$1\.$2 [L]</code></p>
<p>Is better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Wright</title>
		<link>http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/comment-page-1/#comment-64210</link>
		<dc:creator>Brad Wright</dc:creator>
		<pubDate>Tue, 08 Apr 2008 07:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2008/04/08/automatic-asset-versioning-in-django/#comment-64210</guid>
		<description>Hey Stu,

It seems &lt;a href=&quot;http://www.thinkvitamin.com/features/webapps/serving-javascript-fast#comment-846&quot; rel=&quot;nofollow&quot;&gt;Opera and Safari don&#039;t cache file paths with query strings&lt;/a&gt;, as per the HTTP spec, and given that it&#039;s part of the spec we have no guarantee that other browsers won&#039;t behave the same in the future. Probably best to do something like:

&lt;code&gt;return path_string.replace(&#039;.css&#039;, &#039;.%d.css&#039; % mtime)&lt;/code&gt;

And have something like this in mod_rewrite:

&lt;code&gt;RewriteRule ^/static/([a-z-]+)\.[0-9]+\.(css&#124;js) /static/$1\.$s [L]&lt;/code&gt;

This keeps the filenames looking like: &lt;code&gt;/static/css/style.1207433992.css&lt;/code&gt;, but rewrites them to the latest versions in your static server.</description>
		<content:encoded><![CDATA[<p>Hey Stu,</p>
<p>It seems <a href="http://www.thinkvitamin.com/features/webapps/serving-javascript-fast#comment-846" rel="nofollow">Opera and Safari don&#8217;t cache file paths with query strings</a>, as per the HTTP spec, and given that it&#8217;s part of the spec we have no guarantee that other browsers won&#8217;t behave the same in the future. Probably best to do something like:</p>
<p><code>return path_string.replace('.css', '.%d.css' % mtime)</code></p>
<p>And have something like this in mod_rewrite:</p>
<p><code>RewriteRule ^/static/([a-z-]+)\.[0-9]+\.(css|js) /static/$1\.$s [L]</code></p>
<p>This keeps the filenames looking like: <code>/static/css/style.1207433992.css</code>, but rewrites them to the latest versions in your static server.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

