4
votes

Newbie question: I want to use a cloud storage bucket as the origin for cloud cdn. Not sure if this is possible. Currently I have the CDN turned on for the load balancer but my understanding is that it will only cache content that is coming from my domain.com and has the appropriate headers set. The assumption of course is that the CDN pops are closer to my user's location than the bucket which is much farther away and fetching from the cdn will be faster than using bucket urls (mostly static images). Thanks.

3

3 Answers

2
votes

Cloud CDN uses HTTP(S) load balancing as the origin for cacheable content, therefore you have to use a load balancer in front of your bucket in order to configure CDN. This page explains how to enable and disable Google Cloud CDN on a load balancing configuration with a bucket. I believe this guide is more simpler and complete than the provided by @iPhoney. In any case I would also check the 'Best practices for content delivery'

2
votes

Google Cloud storage includes edge-caching of public content by default. Data will be cached in 90+ POPs around the world with no extra setup. You can also use the Google CDN, or a 3rd party one. The best discussion on the options I've come across was during the Google Cloud Next '18 session Best Practices for Storage Classes, Reliability, Performance and Scalability. The entire video is useful, but here's link to the content distribution topic.

1
votes

After a lot of searching and no responses, I stumbled across this: HTTP(S) Load Balancing with Google Cloud Storage looks like this feature is in alpha. Hope this helps someone trying to do this.