54

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.

AJB
  • 7,389
  • 14
  • 57
  • 88

4 Answers4

33

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

AJB
  • 7,389
  • 14
  • 57
  • 88
Chris Madden
  • 2,510
  • 2
  • 17
  • 11
25

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!

Will Hayworth
  • 1,272
  • 10
  • 22
  • Thanks for the informative answer, Will! There's some misleading info out there about the nature of GCS that threw me off. Very helpful, thanks! – AJB Oct 05 '16 at 05:57
  • You're quite welcome. :) Thanks for being a customer! – Will Hayworth Oct 05 '16 at 06:10
  • 12
    @Will, The link at https://cloud.google.com/appengine/docs/flexible/java/serving-static-files says that "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." Can you please help me understand if using CDN along with GCS is required for public web assets (static documents, CSS, etc.)? – Ankur Kanoria Jun 14 '17 at 09:58
  • @AnkurKanoria That must be where the blog post I found (but can't find again) got their info from. It ended up morphing into something like "Google Cloud Storage is already a CDN without any special setup". Telephone game. – AJB Jul 14 '17 at 07:33
  • 1
    @AnkurKanoria It's not required! But it does offer additional features and might reduce your latency. – Will Hayworth Jul 20 '17 at 20:18
  • 4
    That's $18/month just to add a load balancing rule to enable CDN with Cloud Storage? Ridiculous :/ – Jonathan Lin Oct 08 '18 at 12:02
  • 8
    @WillHayworth At this point I have to revoke my "answered" flag, To be honest, this still isn't clear. Have those of us paying for Google Cloud CDN been wasting money given that Google Cloud Storage is already a CDN? Can Google please provide an exact answer. – AJB Dec 04 '18 at 10:43
  • 1
    @AJB That question does not make sense. It's not like "being a CDN" is a 100% standardized definition. It's up to each person to decide what products and services they need. GCP GCS reaches certain locations, GCP CDN reaches certain other locations. They also differ in certain features, and also overlap in some features (such as signed URLs). The question is answered. – thnee Sep 24 '19 at 07:59
  • 2
    @thnee I couldn't disagree more. If you read the comment by Ankur Kanoria above the link does **specifically** state: "Cloud Storage essentially works as a CDN". And if that's true, then why are the rest of us paying for GCP CDN? It seems to me that Google's GCS infra was already designed to push everything out to their existing CDN, and now they're just selling that piece-meal to the public. What we're saying is that we think GCP CDN is phantom-ware, with a higher price tag. – AJB Oct 11 '19 at 08:51
  • @thnee Also, if you look at the age of this question, and the response that it's garnered from the dev community that should speak volumes. We wouldn't even be having this discussion if Google (a trillion-dollar global tech behemouth) could explain their product, and their pricing model succinctly. They have failed to do so. And this is one tiny example of the myriad ways that GCP will ultimately fail. It's important to notice that there is no SO question like this with regard to AWS Cloudfront, or Cloudflare, or Fastly, or any other CDN/Edge Provider. This is yet another Google fail. – AJB Oct 11 '19 at 08:57
8

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

Ronen Rabinovici
  • 8,680
  • 5
  • 34
  • 46
6

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

mathematics-and-caffeine
  • 1,664
  • 2
  • 15
  • 19