TriPSs
TriPSs

Reputation: 117

Google Cloud Storage always returning cache control private

We have a Google Cloud LB setup with an backend storage bucket and CDN enabled, i added the allUsers member with Storage Object Viewer permissions so we can reach the public data with an normal url.

The problem: We always get cache-control: private, max-age=0 header and this only goes away if we add the allUsers to the specific object, is there a way to set it to the whole bucket? Now none of our assets are being cached.

Upvotes: 1

Views: 1091

Answers (1)

Mike Schwartz
Mike Schwartz

Reputation: 12145

Cache-Control can only be set to public on publicly readable objects. This used to be documented here: https://web.archive.org/web/20180923170014/https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata

As of 2022, it looks like this is still true, but it is no longer mentioned on the same documentation page.

Upvotes: 1

Related Questions