Skip to content

Instantly share code, notes, and snippets.

@jermainee
Last active June 10, 2021 15:13
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 jermainee/5c631a1f96100f1134f1bc7db428bcc5 to your computer and use it in GitHub Desktop.
Save jermainee/5c631a1f96100f1134f1bc7db428bcc5 to your computer and use it in GitHub Desktop.
Caching static files on NGINX
location ~*\.(jpg|jpeg|png|gif|ico|css|js|webp)$ {
add_header Cache-Control "public";
expires 365d;
log_not_found off;
access_log off;
}
location ~*\.(pdf)$ {
add_header Cache-Control "public";
expires 30d;
log_not_found off;
access_log off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment