Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Using .htaccess to configure ETag response

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

Simple

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"

Specific

FileETag INode,
FileETag MTime,
FileETag Size,
FileETag INode MTime,
FileETag INode Size or
FileETag MTime Size may also be set.

Omitted

FileETag None

None
If a document is file-based, no ETag field will be included in the response

Targeted

Use of the FilesMatch directive allows us to set different rules for different files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top