LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   How are ETag generated by default? (http://www.litespeedtech.com/support/forum/showthread.php?t=5774)

romfladef 03-16-2012 09:37 AM

How are ETag generated by default?
 
Sorry, the browser's session had expired while I was writing this.

Hi all, I'm new to the forum: I know that LiteSpeed doesn't handle the FileETag option in .htaccess, but my question is a little different! ;)

I noticed that the server produce ETag like:

6106-4f5f3bc1-0

How are those generated by default? Thank you! ;)

webizen 03-16-2012 11:43 AM

Here is a general answer:

http://en.wikipedia.org/wiki/HTTP_ETag

Common methods of ETag generation include using a collision-resistant hash function of the resource's content, a hash of the last modification timestamp, or even just a revision number.

Edit:

ETag '-0' is set when "No I-Node in ETag" is set to Yes.

romfladef 03-16-2012 12:02 PM

Quote:

Originally Posted by webizen (Post 32312)
Here is a general answer:

http://en.wikipedia.org/wiki/HTTP_ETag

Common methods of ETag generation include using a collision-resistant hash function of the resource's content, a hash of the last modification timestamp, or even just a revision number.

Usually, ETag are provided by Apache with: INode MTime Size, with CRC32 as cryptographic algorithm... but I noticed that LiteSpeed has another way to generate them (apart from the INode removal by the control panel I can't access in my hosting). I wasn't able to decipher it. I mean, -0 seems to be an incremental number, while I can't understand what the first and the second field represent. There are several chipers to encode ETag, from MD5 to CRC32. I'd like to use the same default algorithm to generate ETag via PHP for dynamic contents, because I can't modify them via FileETag on .htaccess that's unsupported by LiteSpeed for image, etc.! I tried looking at the web servers' sources, but it didn't help! ;)

webizen 03-20-2012 02:31 PM

it is unnecessary to use the same algorithm for dynamic contents as LSWS does not honor that anyway.


All times are GMT -7. The time now is 03:57 PM.