Setting a far future expires header for your Rails app static assets in your Nginx server

This post has been moved to my new blog, check it out!

This blog is being terminated :)

2 Responses to “Setting a far future expires header for your Rails app static assets in your Nginx server”

  1. blythe Says:

    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?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: