Skip to content

Commit 78caa9e

Browse files
committed
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".
1 parent 208a928 commit 78caa9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

root-files/opt/flownative/lib/nginx-legacy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ EOM
193193
proxy_set_header Authorization "";
194194
add_header Via 'Beach Asset Proxy';
195195
${addHeaderStrictTransportSecurity}
196-
proxy_pass https://storage.googleapis.com/${BEACH_GOOGLE_CLOUD_STORAGE_PUBLIC_BUCKET}/\$1\$is_args\$args;
196+
proxy_pass https://storage.googleapis.com/${BEACH_GOOGLE_CLOUD_STORAGE_PUBLIC_BUCKET}/\$1\$is_args\$args?reqid=\$request_id;
197197
expires ${NGINX_STATIC_FILES_LIFETIME};
198198
}
199199
EOM

0 commit comments

Comments
 (0)