0

I have enabled "allUsers" with "storage legacy object reader permission". Now how can i find CDN is active or not ? Please help me. Thanks

3 Answers3

2

To use a Google Cloud CDN with Cloud Storage requires an HTTP(S) Load Balancer. To see if you have a CDN configured, look at the configuration for your load balancers. You can also check the Cloud CDN page in the Google Cloud Console:

https://console.cloud.google.com/networking/cdn/list

John Hanley
  • 74,467
  • 6
  • 95
  • 159
1

In addition of @JohnJanley answer, you maybe have been confused by this feature description

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

Cloud Storage acts as a CDN, but it's not a CDN and it doesn't use Google CDN. For controlling the cache, you can play with metadata

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • 1
    To be precise, Cloud Storage has a simple caching layer - provided the correct cache headers are set - but does not provide global caching or the reduced Cloud CDN egress rate. – elithrar Dec 23 '19 at 22:22
1

First setup the base components:

  1. Create storage bucket
  2. Create HTTP(S) Load Balancer and tick the CDN checkbox

Next, for each object to be cached:

  1. Make the object publicly readable
  2. Set object metadata cache-control headers to include public and an max-age to store in the cache, for example Cache-Control:public,max-age=3600

To test if an object was served by the Cloud CDN access the object using your load balancer's hostname and look for the Age: response header which is added by Cloud CDN:

$ curl -s -D - -o /dev/null http://example.com/style.css HTTP/1.1 200 OK Date: Tue, 16 Feb 2016 12:00:30 GMT Content-Type: text/css Content-Length: 1977 Cache-Control: max-age=86400,public Via: 1.1 google Age: 2

Chris Madden
  • 2,510
  • 2
  • 17
  • 11