And our beloved Jackie Chan is not going out of business - facebook.com/photo.php?fbid… - he's just not going to keep breaking bones anymore ;D 1 day ago
Setting a far future expires header for your Rails app static assets in your Nginx server
After changing the nginx config twice to include new folders, I fixed the default path of assets to point to a common folder.
Paperclip::Attachment.default_options[:path] = ‘uploads/:class/:attachment/:id/:style_:basename.:extension’
I was toying with setting expiry headers for page cached content to 12 hours using similar nginx directives. (expires 12h;) However, the first request 404s since nginx breaks before the mongrel has generated the content. A simple post deploy recipe to touch all cached pages works but feels dirty. Is there more nginx trickery for this situation?
September 27, 2009 at 5:03 am
After changing the nginx config twice to include new folders, I fixed the default path of assets to point to a common folder.
Paperclip::Attachment.default_options[:path] = ‘uploads/:class/:attachment/:id/:style_:basename.:extension’
I was toying with setting expiry headers for page cached content to 12 hours using similar nginx directives. (expires 12h;) However, the first request 404s since nginx breaks before the mongrel has generated the content. A simple post deploy recipe to touch all cached pages works but feels dirty. Is there more nginx trickery for this situation?
September 27, 2009 at 12:14 pm
Hey Blythe,
Ezra’s original post about Nginx in front of a mongrel cluster has rules to perform this kind of magic – http://brainspl.at/articles/2006/08/23/nginx-my-new-favorite-front-end-for-mongrel-cluster
But this won’t work if you’re running on Passenger.