Reputation: 39
How can I cache assets stored on google cloud storage (GCS)? I've been trying to make it work in the past 2 days with no luck. My website have backend & frontend, and the asset is stored on GCS. I tried the following guide:
b. https://cloud.google.com/storage/docs/hosting-static-website
c. https://cloud.google.com/storage/docs/static-website#tip-dynamic
Let say my website is example.com, here's what I did:
I created a bucket on GCS "img.example.com"
On Cloudflare I set CNAME with the following: Name: img.example.com Value: c.storage.googleapis.com
I set all object in GCS bucket 'readable by public' (https://cloud.google.com/storage/docs/access-control/making-data-public#buckets)
The image is still not cached by Cloudflare and the header status still not showing CF-Status. Am I missing something? Any help would be greatly appreciated.
Thank you.
Upvotes: 3
Views: 2268
Reputation: 39
I changed the link from https://storage.googlesapis.com/subdomain.mysite.com/... to https://subdomain.mysite.com/... (simply removing "storage.googleapis.com") and it works! Hope it helps other that stuck as well.
Upvotes: 0