0
votes

I've set up Google Cloud CDN with a Storage Bucket as a backend and tested that my requests were being cached before deploying into production use.

I am now finding that only certain paths/objects are being cached. (Confirmation in Logs Viewer, latency difference in requests and presence of Age: header in the response.

After testing all morning I'm finding that there paths where all objects under that path are not being cache and paths where all objects under that path are being cached.

Permisions and Cache-Control: headers were set globally using gsutil command.

Any pointers from anyone with Cloud CDN experience would be appreciated.

Path that is being cached: http://assets.affcdn.net/1/rolling.gif

Path that is not being cached: http://assets.affcdn.net/v3/android.png

1
Hi, from a first look, it seems an internal header is somehow set on the second object that overrides the public cache-control and disables caching. The Cloud Storage team has reproduced the issue and is looking into it. - lot
Thanks for your response. Good to know it has been confirmed as a bug. I filed a bug on Cloud CDN issue tracker not long after asking here, hopefully there'll be some resolution soon. - Guy Thouret
Did you update or otherwise modify the objects? I can no longer reproduce the issue, both URLs are being cached as expected now. - lot
Yes this issue was resolved, I've added the solution as the answer. - Guy Thouret

1 Answers

3
votes

This issue was resolved by editing the permissions of non caching files and granting read permission to 'allUsers' group.

This was not very well documented as the cache criteria only states that the files be shared publicly, which they had.

The GCP documentation Making Data Public had been followed previously and while this does make data public it does not make it cacheable as the allUsers permission is missing.