Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I suppress the Etag header from being issued on AWS Cloudfront?

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?

like image 830
Zhami Avatar asked Jan 27 '11 13:01

Zhami


People also ask

What is ETag in CloudFront?

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".

How do I stop hitting from CloudFront?

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.

How do I prevent CloudFront from caching certain files?

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.


1 Answers

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.

like image 198
Rajiv Avatar answered Oct 01 '22 02:10

Rajiv