3 ms·
But I still can't set a bucket-wide policy for caching to be applied automatically to new files. So in other ways, consistency is inconveniently eventual.
by jacques_chester 9y ago
But I still can't set a bucket-wide policy for caching to be applied automatically to new files. So in other ways, consistency is inconveniently eventual.
- justinph 9y agoThis is pretty easy to do with a cloud function. I was a little apprehensive at first, but have been using it across many buckets and haven't seen any issues. Here's a version of the script I'm using: https://gist.github.com/justinph/acb6301d63b407e1fb205cbb42e08cba https://gist.github.com/justinph/acb6301d63b407e1fb205cbb42e... Google recently announced some changes with cloud storage and pubsub triggers that potentially means that you could only have this trigger when a file is newly created, not every change. I haven't looked into that yet.
- jacques_chester 9y agoThe code I've picked up from a predecessor uses a Concourse task to achieve a similar end. But it's just annoying that I can't set a policy on the bucket. As an aside, it looks as though Google's golang API for GCS has a way to set the policy when you provide the file, so maybe at some point I can close this issue: https://github.com/concourse/semver-resource/issues/61 https://github.com/concourse/semver-resource/issues/61
- BrandonY 9y agoWhile there is not an option to set a default cache policy on a bucket, you can specify a cache policy as part of object uploads, although I admit that this can be inconvenient if you upload from multiple clients. In addition, caching only applies to objects that are anonymously readable. Private objects are never cached.