How to turn off Etag with htaccess?

2019-02-12 11:14发布

问题:

One of my friend says, etags on off mode for speed up page loading. How to off etags with htaccess?

回答1:

To unset Etags use 3 lines below:

Header unset Pragma
FileETag None
Header unset ETag 

But, to increase page loading speed, my advice is YSlow. perfect tool & Yslow recommends to use Etags instead of setting off.



回答2:

Putting the following in your .htaccess should do the trick.

Header unset ETag
FileETag None

Note: Disabling etags only helps if you are hosting the same content from more than 1 server (such as when using a cluster or CDN). Take a look at wikipedia or yahoo best practices for more information.