Modify nginx.conf to cache HTML for 10m and static resources for 1h

Fixes #61
This commit is contained in:
wiz 2021-03-08 18:50:21 +09:00
parent a52f98c39d
commit d5cc558670
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -34,6 +34,13 @@
# fallback for all URLs i.e. /address/foo /tx/foo /block/000 # fallback for all URLs i.e. /address/foo /tx/foo /block/000
location / { location / {
try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect; try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect;
add_header Cache-Control "public, no-transform";
expires 10m;
}
location /resources {
try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect;
add_header Cache-Control "public, no-transform";
expires 1h;
} }
location @index-redirect { location @index-redirect {
add_header vary accept-language; add_header vary accept-language;