From 78caa9e87491124ef7276ee56bd122dde835a279 Mon Sep 17 00:00:00 2001 From: Robert Lemke Date: Mon, 9 May 2022 08:41:53 +0200 Subject: [PATCH] Add query parameter for GCS cache busting Google may store storage objects in various edge caches according to the given cache-lifetime controlled via Cache-Control and Expires. Therefore, if metadata was changed, these changes may not be visible to this Nginx. In order to get always the freshest version, we append the request id as a query parameter as a "cache buster". --- root-files/opt/flownative/lib/nginx-legacy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root-files/opt/flownative/lib/nginx-legacy.sh b/root-files/opt/flownative/lib/nginx-legacy.sh index fbc075e..a408a7a 100644 --- a/root-files/opt/flownative/lib/nginx-legacy.sh +++ b/root-files/opt/flownative/lib/nginx-legacy.sh @@ -193,7 +193,7 @@ EOM proxy_set_header Authorization ""; add_header Via 'Beach Asset Proxy'; ${addHeaderStrictTransportSecurity} - proxy_pass https://storage.googleapis.com/${BEACH_GOOGLE_CLOUD_STORAGE_PUBLIC_BUCKET}/\$1\$is_args\$args; + proxy_pass https://storage.googleapis.com/${BEACH_GOOGLE_CLOUD_STORAGE_PUBLIC_BUCKET}/\$1\$is_args\$args?reqid=\$request_id; expires ${NGINX_STATIC_FILES_LIFETIME}; } EOM