Reputation: 2011
Using ySlow, it recommends that I use eTags. I never heard of them before today. The question is now, how do I configure eTags?
I just spent the last 2 hours trying to figure this out. I tried adding various recommended scripts to my .htaccess file, but with no luck. ySlow keeps complaining...
My site is a secure site(https) on a litespeed web server. I seen some say you can't configure eTags on a litespeed web server. Is this true?
Thanks.
Upvotes: 7
Views: 19408
Reputation: 13263
Note (2021-05-14) :
While historically there has been somewhat valid reasons to disable ETags - mainly pushed by Yahoo serving things from server farms and unable to implement ETags properly across all servers - ETags should not be disabled by default and chances are Yahoo's problems do not apply to you.
I think you're supposed to disable ETags, not turn them on.
Try this:
Header unset Pragma
Header unset ETag
FileETag None
References:
How to turn off Etag with htaccess?
http://davidwalsh.name/yslow-htaccess
Upvotes: 6
Reputation: 4312
.htaccess
to configure ETag responseThe OP is specifically asking about configuring etags on a Litespeed web server, but anywhere .htaccess
can be used, the method(s) should remain the same.
FileETag All
This sets the response etag, for all files, calculated from all three possible components:
INode
The file's i-node number will be included in the calculation
MTime
The date and time the file was last modified will be included
Size
The number of bytes in the file will be included
i.e. Setting
All
All available fields will be used. This is equivalent to:
FileETag INode MTime Size
e.g. Our response might be something like ETag:"a020a81-1dd-55073fdbf86fe"
FileETag INode
,
FileETag MTime
,
FileETag Size
,
FileETag INode MTime
,
FileETag INode Size
or
FileETag MTime Size
may also be set.
FileETag None
None
If a document is file-based, no ETag field will be included in the response
Use of the FilesMatch directive allows us to set different rules for different files.
Upvotes: 6
Reputation: 458
Or, I don't know... Properly set them without the piece that makes them unique to a server.
FileETag MTime Size
I understand that it's easier to just tell people to not bother. But there is a lot of misinformation out there about ETags. They're not perfect, but can be handy when configured correctly.
Upvotes: 14