Created
April 10, 2017 06:33
-
-
Save Edarlingen/be799ea5a995e8807b528d6f256f31da to your computer and use it in GitHub Desktop.
nginx: кэш
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^.+\.(css|txt|js)$ { | |
root $root_path; | |
gzip_static on; | |
access_log off; # не пишем логи | |
add_header Cache-Control public; | |
expires 7d; # кешируем у клиента на 7 дней | |
add_header ETag ""; | |
} | |
location ~ ^.+\.(jpg|jpeg|gif|png|ico|pdf|ppt|bmp|js)$ { | |
root $root_path; | |
gzip_static on; | |
access_log off; # не пишем логи | |
add_header Cache-Control public; | |
expires 30d; # кешируем у клиента на 30 дней | |
add_header ETag ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment