Skip to content

Instantly share code, notes, and snippets.

@Kaiderella
Created August 22, 2018 03:26
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 Kaiderella/201245e565ca5e4f04ca33e6844b7242 to your computer and use it in GitHub Desktop.
Save Kaiderella/201245e565ca5e4f04ca33e6844b7242 to your computer and use it in GitHub Desktop.
Cache-Control Headers on Nginx
location ~* \.(png|jpg|jpeg|webp|gif)$ {
expires 365d;
add_header Cache-Control "public, no-transform";
}
location ~* \.(js|css|pdf|html|swf)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment