Let me start off by saying I'm not a developer, coder, or engineer. I use googlecloud to host a staging site to show clients html5 animations for review. About a year ago googlecloud changed something and whenever I make revisions to my htm5 banners and repost them to googlecloud it takes up to an hour for the revision to refresh in any browser. Is there a setting in googleCloud that will refresh new files instantly instead of telling the client they have to wait an hour to see revisions? Like I said a year ago I didn't have this issue all updates were instant. I know I can just go and change the file name but I don't want to rename the file every time I make a revision.
1 Answers
As said in this answer How to Quickly Update Static Site on Google Cloud Storage?
It's more likely you're looking at a cache effect. Which can happen:
- inside the Google cloud:
- work around it using a made up extra URL query parameter, like
?ignoreCache=1
, see https://stackoverflow.com/a/37124554/4495081, or - see Cache-Control and Editing object metadata if you want a more permanent solution (but which also affects your site's performance, so think twice about what you're doing)
- work around it using a made up extra URL query parameter, like
- in your browser - try clearing your browser's cache after deployments
- pretty much anywhere in between (and you have no control over this).
Or in this question Missing a step to update a static ReactJS site on GCloud
This is how I was able to update my static site on gcloud using the command line utility.
Create a new bucket, ideally name it with a version like appname-v2
Copy your recent build into that bucket
Delete the old bucket
From your main area in your console where you see your app's directory do
gsutil rsync -r gs://[bucketname] ./appname
cd
into the directoryrun
gcloud app deploy
So if your latest version of your app is 3, if your app's directory is stackoverflow, and your bucket is "bucket" then your gsutil command would look like
gsutil rsync -r gs://bucket-v3 ./stackoverflow

- 346
- 3
- 18