AJB
AJB

Reputation: 7590

Is Google Cloud Storage an automagical global CDN?

I’m attempting to setup a Google Cloud Storage bucket to store and serve all the static objects for my site. I’m also attempting to push all the objects in that bucket out to all the global edge locations offered by Google Cloud CDN.

I’ve created a bucket on Google Cloud Storage: cdn.mysite.com. I chose “US” multi-region for the bucket location setting.

My assumption is that any object stored in this bucket will be replicated to all the us-* regions for high-durability purposes, but not pushed out to all the Google Cloud CDN global edge locations for CDN purposes.

Or are all my objects in my “US” multi-region bucket already automagically pushed out to all of Google Cloud CDN edge locations?

I’m gobsmacked that I can’t figure out whether or not my bucket is already a CDN or not. Even after two days of searching (Google, ironically).

Thanks in advance for any help.

Upvotes: 56

Views: 25369

Answers (4)

mathematics-and-caffeine
mathematics-and-caffeine

Reputation: 2215

2024: Partly.

Cloud Storage behaves like a Content Delivery Network (CDN) with no work on your part because publicly readable objects are cached in the Cloud Storage network by default.

But:

Feature                             Cloud Storage   Cloud CDN
Max cacheable file size             10 MiB          5 TiB
Default cache expiration            1 hour          1 hour (configurable)
Support custom domains over HTTPS   No              Yes
Cache invalidation                  No              Yes

In particular, if you serve videos to your users, they are likely to be larger than 10 MiB and will not be cached then.

Also note that it only uses caching for public objects.

https://cloud.google.com/storage/docs/caching

Upvotes: 11

Chris Madden
Chris Madden

Reputation: 2660

The best discussion I've seen of Cloud Storage edge caching vs. Cloud CDN 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.

One key note from the summary is that edge caching gives you many of the benefits of a CDN, but you still pay for data egress. The Cloud CDN gives you caching, which can lower the cost of egress. They also outlined a couple other options.

enter image description here

Upvotes: 36

Ronen Rabinovici
Ronen Rabinovici

Reputation: 9132

Oct 2020 - Yes - if you take Google's word for it:

Cloud Storage essentially works as a content delivery network. This does not require any special configuration because by default any publicly readable object is cached in the global Cloud Storage network.

https://cloud.google.com/appengine/docs/standard/java11/serving-static-files

Upvotes: 8

Will Hayworth
Will Hayworth

Reputation: 1270

Cloud CDN and Cloud Storage are distinct, so objects in your multi-region bucket are not necessarily pushed to Cloud CDN edges. You can find information about Cloud Storage regions here; as you probably already know, Cloud CDN's edge locations are mapped out here. However, it's very straightforward to integrate Cloud Storage with Cloud CDN: just follow these steps!

Upvotes: 26

Related Questions