Search code examples
google-cloud-platformgoogle-cloud-storagegoogle-cloud-cdn

Is using Google Cloud CDN with Google Storage redundant in terms of Caching?


I recently stumbled over Google CDN and was setting it up right away to use it as a cachable CDN for my frontend's image assets.

Now I had a small issue with user profile picture that had some default caching in Google Storage - I therefore set the cache-control header to private in that case.

As I did that I was a bit sceptical. I just changed a caching mechanic on the google storage image BlobInfo instead in the Google Cloud CDN. That's where my question came up if I have something like double cachine here. One at the CDN and one at the Google Storage side.

I am pretty sure the Cloud CDN documentation used Google Storage as example and therefore I thought that this is meant to be used together. Now however I am a bit confused.


Solution

  • In fact, it depends! If your cloud storage is, for instance, US multiregion, and your users only in the US, YES the cache of CDN and Cloud Storage are redundant.

    Now, with the same configuration, you have users all around the globe, the CDN will cache the content locally, to the closest location to the users. With Cloud Storage, the cache will only lived in the US multiregion, not global as a CDN.