Commit 6616a03a authored by Julien Enselme's avatar Julien Enselme

Improve cache for nginx configurations

parent 0e51ecc6
Pipeline #74604440 failed with stage
in 42 seconds
......@@ -79,14 +79,15 @@ server {
# These scripts must not be cached for too long or
# we may encounter problem (bugs or tracking not updated).
location ~ ^/(tracking.js|Intl.js|robots.txt)$ {
expires 1d;
expires 7d;
try_files $uri /$uri =404;
}
# Set a very long cache on scripts and images
# (anything that reaches this point and have an extension).
# Set a very long cache on scripts and images since their URL contains their hash making them immutable.
# We can keep them for as long as we want.
# That's anything that reaches this point and have an extension.
location ~ .*\.[a-z]+$ {
expires 7d;
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri /$uri =404;
}
......
......@@ -34,6 +34,7 @@ server {
add_header X-Frame-Options DENY;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Cache-Control "public, max-age=31536000, immutable";
location / {
add_header 'Access-Control-Allow-Methods' 'GET';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment