Skip to content

Commit

Permalink
Set Cache-Control header for proxied GCS resources
Browse files Browse the repository at this point in the history
The "expires" statement does not seem to have an effect – the lifetime
provided by Google always won. However, providing Cache-Control might
work and solve as a hotfix for flownative/flow-google-cloudstorage#32

#7
  • Loading branch information
robertlemke committed May 5, 2022
1 parent 5b3435e commit 099f04c
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 @@ -191,9 +191,9 @@ EOM
# pass persistent resource requests to GCS
location ~* "^${BEACH_PERSISTENT_RESOURCES_BASE_PATH}([a-f0-9]{40})/" {
resolver 8.8.8.8;
expires ${NGINX_STATIC_FILES_LIFETIME};
proxy_set_header Authorization "";
add_header Via 'Beach Asset Proxy';
add_header Cache-Control 'public, max-age=${NGINX_STATIC_FILES_LIFETIME}';
${addHeaderStrictTransportSecurity}
proxy_pass http://storage.googleapis.com/${BEACH_GOOGLE_CLOUD_STORAGE_PUBLIC_BUCKET}/\$1\$is_args\$args;
}
Expand Down

0 comments on commit 099f04c

Please sign in to comment.