Site icon David Yin's Blog

How to Disable ETags in Apache httpd.conf

What are ETags?

ETag is a standard used for determining whether the client (web browser) already has the latest version. If it has, it’s simply loaded from local cache. If not, the new version is requested.

An ETag is a hash generated based on either the inode number, the last modified time and / or the size (in bytes) of a file. The default behaviour in Apache webserver is to use all properties to generate the ETag.

 

What’s the problem with ETags?

Although etags do no harm in a single server set-up, it is harmful when you have multiple servers replication the served files. The problem is that the generated ETags most likely differ per server. So when the client re-requests an un-updated file on a different server than the last time the ETags do not much and a new version is requested, while this would not be necessary. This hurts performance (page load). You can find more information about this in the ‘Configure ETags‘ article on the Yahoo Developer Network.

How To Disable ETags in httpd.conf

To disable the use of ETags in the Apache webserver simply put the following FileETag directive in your httpd.conf:

FileETag none

This will disabled the use of ETags completely.

 

Exit mobile version