I got some problem when updating my json file which located in a bucket, and will be called by a html page. I will update my json file every 5 minutes from the command line, and this can be done. However, even though the json file itself is updated and set to be public, the public link is still showing the old content not the new content.
If I click the json file, I can see that the content has been changed, but if I click the public link, the content still remains not updated.
Does anybody know how much time it takes for Google Cloud Storage to load the buffer so that the new content will be shown in the public link?
Or is there any method to update the json file and get the public link updating instantly?
Thank you!
By default, publicly visible objects accessed anonymously have a cache-control header set to 1 hour. You can override this when you upload a new object by explicitly setting the cacheControl metadata to something else.
If you're using gsutil to upload the object, you could do it like this:
gsutil -h "Cache-Control:no-cache, max-age=0" \
cp -a public-read myfile.json gs://mybucket
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With