Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCS caching means versions are out of date #61

Open
jchesterpivotal opened this issue Feb 12, 2018 · 1 comment
Open

GCS caching means versions are out of date #61

jchesterpivotal opened this issue Feb 12, 2018 · 1 comment

Comments

@jchesterpivotal
Copy link

GCS sets a 3600 second max-age for objects uploaded to GCS buckets:

Unless otherwise specified, the Cache-Control setting for publicly accessible objects is 3600 seconds ... If you allow caching, at download time you might see older versions of objects, even after uploading a newer replacement object, because the older objects remain in the cache for a period of time.

This means that when I put to a semver-resource, I might not be able to successfully get that version back for up to an hour.

This causes some fascinating misbehaviour. The only current workaround is to manually set Cache-Control headers in the bucket. But this means that I have a task following around after every put, which isn't very convenient.

Google suggest setting Cache-Control: private to prevent caching. Can we please see if this improves behaviour?

@rmmh
Copy link

rmmh commented Feb 24, 2018

Changing the end of driver/gcs.go:PutObject from

return obj.NewWriter(context.Background()), nil

to

w := obj.NewWriter(context.Background())
w.CacheControl = "private"
return w, nil

would fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants