Skip to content

Commit

Permalink
Merge pull request #83 from alphagov/update-serving-stale-integration
Browse files Browse the repository at this point in the history
Update to match integration stale content handling
  • Loading branch information
MahmudH authored Jun 4, 2024
2 parents 075ecaa + ff595e1 commit 75cc8dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/datagovuk/datagovuk.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,13 @@ sub vcl_fetch {
return (pass);
}

if (beresp.status == 500 || beresp.status == 503) {
set beresp.ttl = 1s;
set beresp.stale_if_error = 5s;
return (deliver);
}
%{ if environment != "integration"}
if (beresp.status == 500 || beresp.status == 503) {
set beresp.ttl = 1s;
set beresp.stale_if_error = 5s;
return (deliver);
}
%{ endif ~}

if (beresp.http.Expires || beresp.http.Surrogate-Control ~ "max-age" || beresp.http.Cache-Control ~"(s-maxage|max-age)") {
# keep the ttl here
Expand Down

0 comments on commit 75cc8dc

Please sign in to comment.