use stale-while-revalidate to cache less agressively

This commit is contained in:
Gabriel Fontes
2024-03-19 13:30:42 -03:00
parent a20980d916
commit 25bdaacaab
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -23,13 +23,13 @@ in
"/" = {
root = "${website}/public";
extraConfig = ''
add_header Cache-Control "max-age=${toString (minutes 15)}";
add_header Cache-Control "max-age=${toString (minutes 5)}, stale-while-revalidate=${toString (minutes 15)}";
'';
};
"/assets/" = {
root = "${website}/public";
extraConfig = ''
add_header Cache-Control "max-age=${toString (days 30)}";
add_header Cache-Control "max-age=${toString (hours 1)}, stale-while-revalidate=${toString (days 30)}";
'';
};
+1 -1
View File
@@ -59,7 +59,7 @@ in
root = themes;
extraConfig = ''
add_header Access-Control-Allow-Origin *;
add_header Cache-Control "max-age=${days 30}";
add_header Cache-Control "max-age=${days 1}, stale-while-revalidate=${days 30}";
'';
};
};