feat: adds caching of asset files #13
@ -8,6 +8,21 @@ server {
|
||||
try_files $uri $uri/index.html =404;
|
||||
}
|
||||
|
||||
# Media: images, icons, video, audio, HTC
|
||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc)$ {
|
||||
expires 1M;
|
||||
access_log off;
|
||||
# max-age must be in seconds
|
||||
add_header Cache-Control "max-age=2629746, public";
|
||||
}
|
||||
|
||||
# CSS and Javascript
|
||||
location ~* \.(?:css|js|ttf|otf|woff2|woff)$ {
|
||||
expires 1y;
|
||||
access_log off;
|
||||
add_header Cache-Control "max-age=31556952, public";
|
||||
}
|
||||
|
||||
location /deploy {
|
||||
{{ if eq (env "AUTH_ENABLED") "1" }}
|
||||
auth_basic "Administrator’s Area";
|
||||
|
||||
Reference in New Issue
Block a user