Skip to content

Instantly share code, notes, and snippets.

@noctivityinc
Created October 31, 2012 16:59
Show Gist options
  • Save noctivityinc/3988290 to your computer and use it in GitHub Desktop.
Save noctivityinc/3988290 to your computer and use it in GitHub Desktop.
nginx add for rails 3.1 and above with paperclip support
location ~* ^/(assets|images|javascripts|system)/ {
# Per RFC2616 - 1 year maximum expiry
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
expires 1y;
add_header Cache-Control public;
# Some browsers still send conditional-GET requests if there's a
# Last-Modified header or an ETag header even if they haven't
# reached the expiry date sent in the Expires header.
# Do NOT unset Last-Modified!
# add_header Last-Modified "";
add_header ETag "";
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment