Skip to content

Commit

Permalink
Add query parameter for GCS cache busting
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
robertlemke committed May 9, 2022
1 parent 208a928 commit 78caa9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root-files/opt/flownative/lib/nginx-legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78caa9e

Please sign in to comment.