0

I want to know if there is a difference between choosing CDN hosting and using google CDN for each script.

Are all my static pages will be available in cdn when choosing cdn hosting?

Finally if CDN cost me a lot, can I choose local web hosting in my country for speed quality?

iehrlich
  • 3,572
  • 4
  • 34
  • 43
Zakaria
  • 39
  • 1
  • 5

1 Answers1

0

I'm not sure what do you mean with 'each script', but an object can be stored in Google Cloud CDN caches only if all of the following are true:

It was served by a backend service or backend bucket with Cloud CDN enabled. It was a response to a GET request. The status code was 200, 203, 300, 301, 302, 307, or 410. It has either a Content-Length header or a Transfer-Encoding header. Additionally, the response must meet both of the following two requirements:

It has a Cache-Control: public header. It has a Cache-Control: s-maxage, Cache-Control: max-age, or Expires header.

For backend buckets, you can satisfy these two requirements by marking the object as shared publicly.

You can enable Google Cloud CDN when you are using a L7 load balancer and if your objects meet all the requirements it will be cached by Google Cloud CDN.

If you can't afford the cost of HTTP(S) load balancer and Google Cloud CDN you always can use an instance in the region nearest to your users. here is a list of the regions available.

https://cloud.google.com/compute/docs/regions-zones/#available