I am using Amazon's Cloudfront CDN for static assets. Couldfront issues an Etag for every GET request. I have set meta data fro all my assets with specific Cache-Control information, which (as I understand) makes the Etag superfluous. I test my site's load performance at WebPageTest.org, and it dings me for these unnecessary Etags. If they are in fact unnecessary, does anyone know of a way to suppress their being emitted?
The calls to the CloudFront will now pass the requests to the Origin, where the ETag is used to verify if the resource has changed. As it hasn't, then a 304 is returned and the Browser kicks in and returns its stored version of "index. html".
1 Answer. Show activity on this post. Disabling cache headers on HEAD responses at your origin will prevent Cloudfront caching the HEAD response itself. So if you issue a HEAD request to the CDN it will look for a matching object in the cache and return a cache hit if it is present.
Configuration on the origin On your custom origin web server application, add Cache-Control no-cache, no-store, or private directives to the objects that you don't want CloudFront to cache. Or, add Expires directives to the objects that you don't want CloudFront to cache.
If you are using an Origin Server and disabled ETag on the origin server, CloudFront would not add the ETag in its headers. I verified it by disabling the ETag on my origin server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With