I have a bucket with READ permission to allUsers and it's working fine but the public url link https://storage.googleapis.com/example_bucket/example.png takes ages to update: if I change the image in storage for a different one with the same name, the bucket view shows the correct image as well as the not public image url https://storage.cloud.google.com/example_bucket/example.png however the public url shows the old image and it takes a long time to update. Could someone explain if this is normal or if I'm doing something wrong?
0
votes
did you happen to find the solution? if any of the the answers provided was useful or the solution, please upvote it or accept it.
- Joss Baron
2 Answers
1
votes
You can set the cache-control when you are uploading the object:
Using gsutil when
- Uploading
gsutil -D -h Cache-Control:"Cache-Control:private, max-age=0, no-transform" cp file gs://BUCKET/file
- Editing:
gsutil set meta
gsutil setmeta -h Cache-Control:"Cache-Control:private, max-age=0, no-transform" gs://BUCKET/file
Or through the console:
Currently, there is no way to set a default cache-control for the bucket.
You might be interested in taking a look into this Viewing / Editing Metadata
