From ff595e1a483832cc71068704bef28d7aa8affc0f Mon Sep 17 00:00:00 2001 From: Mahmud Hussain Date: Tue, 4 Jun 2024 14:16:29 +0100 Subject: [PATCH] Update to match integration stale content handling This is to allow integration to match logic in PR: https://github.com/alphagov/govuk-fastly/pull/82 --- modules/datagovuk/datagovuk.vcl.tftpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/datagovuk/datagovuk.vcl.tftpl b/modules/datagovuk/datagovuk.vcl.tftpl index 0b658df..f6a8f32 100644 --- a/modules/datagovuk/datagovuk.vcl.tftpl +++ b/modules/datagovuk/datagovuk.vcl.tftpl @@ -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