How are ETag generated by default?

Discussion in 'General' started by romfladef, Mar 16, 2012.

  1. romfladef

    romfladef New Member

    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:


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

    webizen Well-Known Member

    Here is a general answer:

    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.


    ETag '-0' is set when "No I-Node in ETag" is set to Yes.
    Last edited: Mar 16, 2012
  3. romfladef

    romfladef New Member

    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! ;)
  4. webizen

    webizen Well-Known Member

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

Share This Page