<?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: Setting Static Asset Expires Headers with nginx and Passenger</title>
	<atom:link href="http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/feed" rel="self" type="application/rss+xml" />
	<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger</link>
	<description>code with a purpose</description>
	<lastBuildDate>Sun, 18 Jul 2010 18:32:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Craig</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-13188</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Fri, 13 Nov 2009 00:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-13188</guid>
		<description>@eno,

Interesting.  I&#039;m wondering if this isn&#039;t an nginx version issue, because the regexp I use in the example works fine for me on my website.

But both you and Adam are saying the check against $location doesn&#039;t work, I&#039;m wondering if its because the $location variable changed in nginx.

what version are you running?  I&#039;m running version 0.6.36 on the server in question.</description>
		<content:encoded><![CDATA[<p>@eno,</p>
<p>Interesting.  I&#8217;m wondering if this isn&#8217;t an nginx version issue, because the regexp I use in the example works fine for me on my website.</p>
<p>But both you and Adam are saying the check against $location doesn&#8217;t work, I&#8217;m wondering if its because the $location variable changed in nginx.</p>
<p>what version are you running?  I&#8217;m running version 0.6.36 on the server in question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eno</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-13187</link>
		<dc:creator>eno</dc:creator>
		<pubDate>Fri, 13 Nov 2009 00:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-13187</guid>
		<description>Hey craig, me again :) Hongli Lai&#039;s example does not work (as Adam already pointed out, because the location test does not include the URL arguments in the test against the regex. Adam&#039;s solution seems ok to me. My own setup is a bit different; if interested check it out here http://radiospiel.org/0x29-my-nginx-config.</description>
		<content:encoded><![CDATA[<p>Hey craig, me again :) Hongli Lai&#8217;s example does not work (as Adam already pointed out, because the location test does not include the URL arguments in the test against the regex. Adam&#8217;s solution seems ok to me. My own setup is a bit different; if interested check it out here <a href="http://radiospiel.org/0x29-my-nginx-config" rel="nofollow">http://radiospiel.org/0&#215;29-my-nginx-config</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-12980</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Thu, 05 Nov 2009 21:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-12980</guid>
		<description>@eno,

You are correct.  Good eye.

I&#039;ve gone ahead and updated the regexp in my example.</description>
		<content:encoded><![CDATA[<p>@eno,</p>
<p>You are correct.  Good eye.</p>
<p>I&#8217;ve gone ahead and updated the regexp in my example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eno</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-12979</link>
		<dc:creator>eno</dc:creator>
		<pubDate>Thu, 05 Nov 2009 21:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-12979</guid>
		<description>Hey craig, I think that your regexp doesn&#039;t match &quot;jpeg&quot; file extensions, but (wrongly) &quot;jg&quot;.</description>
		<content:encoded><![CDATA[<p>Hey craig, I think that your regexp doesn&#8217;t match &#8220;jpeg&#8221; file extensions, but (wrongly) &#8220;jg&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-10428</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Thu, 25 Jun 2009 15:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-10428</guid>
		<description>Adam, my second regexp (the one I am actually using) does the same thing as your example.</description>
		<content:encoded><![CDATA[<p>Adam, my second regexp (the one I am actually using) does the same thing as your example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Byrtek</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-10427</link>
		<dc:creator>Adam Byrtek</dc:creator>
		<pubDate>Thu, 25 Jun 2009 15:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-10427</guid>
		<description>Your first regular expression doesn&#039;t match anything, as nginx doesn&#039;t include query string (part after the question mark) when matching location.

I prefer to set Expires *only* for assets with timestamp included, otherwise your users will have problems when you change the contents of a file without changing the name.

The following directive will cover this case:

location ~* \.(ico&#124;css&#124;js&#124;gif&#124;jp?g&#124;png) {
    if ($args ~* [0-9]+$) {
        expires max;
        break;            
    }        
}</description>
		<content:encoded><![CDATA[<p>Your first regular expression doesn&#8217;t match anything, as nginx doesn&#8217;t include query string (part after the question mark) when matching location.</p>
<p>I prefer to set Expires *only* for assets with timestamp included, otherwise your users will have problems when you change the contents of a file without changing the name.</p>
<p>The following directive will cover this case:</p>
<p>location ~* \.(ico|css|js|gif|jp?g|png) {<br />
    if ($args ~* [0-9]+$) {<br />
        expires max;<br />
        break;<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Armstrong</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-10346</link>
		<dc:creator>Brian Armstrong</dc:creator>
		<pubDate>Sun, 14 Jun 2009 06:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-10346</guid>
		<description>Another big thank you!!  This just helped me finally get expire headers working right on UniversityTutor.com

It&#039;s loading way faster now.  Thanks a ton!</description>
		<content:encoded><![CDATA[<p>Another big thank you!!  This just helped me finally get expire headers working right on UniversityTutor.com</p>
<p>It&#8217;s loading way faster now.  Thanks a ton!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-10260</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Thu, 21 May 2009 20:06:52 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-10260</guid>
		<description>awesome.  glad to help</description>
		<content:encoded><![CDATA[<p>awesome.  glad to help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://craigjolicoeur.com/blog/setting-static-asset-expires-headers-with-nginx-and-passenger/comment-page-1#comment-10259</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Thu, 21 May 2009 20:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://craigjolicoeur.com/blog/?p=125#comment-10259</guid>
		<description>Thanks for this! After hours of trying to figure this out this finally helped me!</description>
		<content:encoded><![CDATA[<p>Thanks for this! After hours of trying to figure this out this finally helped me!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
