cachinghttpsgoogle-cloud-storagegoogle-cloud-cdn

Google Cloud CDN json resource ETag missing from response headers


The ETags are missing from the response headers. Currently, I am using Google Cloud CDN to deliver the resources from Google Cloud Storage (bucket). When the resource is read directly from the bucket, the ETag is present, however, if the resource is obtained through the CDN the ETag is missing.

I am using:

Here is a sample list of response headers of a resource that doesn't include the Etag header: enter image description here

There are a number of other headers present but I do not believe them to be important for the matter at hand.

The below screenshot, shows the Cloud CDN Cache settings: enter image description here

This is the metadata of an individual document within the bucket: enter image description here

The question is, is there a Google Cloud CDN setting that is preventing the caching or ETags from showing in the response headers?

If any more information is needed to make this a bit more clear, please let me know so I can try and provide it.


Solution

  • Just a hunch here, but I see that you have Dynamic Compression enabled and the content-type you have listed is application/json which is a compressible object type. I am suspecting that Cloud CDN is compressing the object which is altering the object and could be stripping your etag value. As a test, perhaps turn off Dynamic Compression to see if the etags bleed through. If the etag is visible after turning off the compression, you have your answer.

    The Cloud CDN service will use the last modified time in lieu of an etag so there is no risk of having out of date content.