We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d3531b8 + 01fb4b6 commit 4dfd21dCopy full SHA for 4dfd21d
1 file changed
datagovuk/datagovuk.vcl.tftpl
@@ -181,6 +181,14 @@ sub vcl_fetch {
181
return (deliver);
182
}
183
184
+ %{ if contains(["staging"], environment) ~}
185
+ # Set the Cache-Control header for /find-assets/ and sub-paths for 1 year
186
+ if (req.url ~ "^/(find-assets|javascript)/" && beresp.status == 200) {
187
+ set beresp.http.Cache-Control = "public, max-age=31536000, immutable";
188
+ set beresp.ttl = 31536000s;
189
+ }
190
+ %{ endif ~}
191
+
192
if (beresp.http.Expires || beresp.http.Surrogate-Control ~ "max-age" || beresp.http.Cache-Control ~"(s-maxage|max-age)") {
193
# keep the ttl here
194
} else {
0 commit comments