Skip to content

Instantly share code, notes, and snippets.

@luisdalmolin
Created March 28, 2017 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisdalmolin/e4008a316529937d45ffcd679dcb45cd to your computer and use it in GitHub Desktop.
Save luisdalmolin/e4008a316529937d45ffcd679dcb45cd to your computer and use it in GitHub Desktop.
Nginx cache config
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|woff|woff2|css|js)$ {
expires 30d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment