Forum

Pre-calculated ETag?

James
28 March 2014, 16:18
I know that the idea of ETagging was shot down when it was first suggested back in 2009, as it required the entire file to be buffered and hashed before d elivery could even begin so the ETag could make it as part of the header, but I'd like to suggest a new idea: precalculated ETags.

Similarly to how Hiawatha can use precompressed GZip files, perhaps we could have a file containing ETags of the files. Perhaps index.hetag (Hiawatha ETag) for all files in the same derectory, or file.etag in the same directory? Timestamp checking could even be implemented to prevent invalid ETags from being used.
The .hetag file could contain file names, timestamps, whatever we need.
*Perhaps* we could even consider Hiawatha hashing a file the first time it's delivered (that is, not hashing the file before it's being sent, but rather hashing it 'on its way out', so the next request will have an ETag.) That way, Hiawatha could update or create an ETag, although that may not be practical or efficient.

Anyway, this is just a thought. Precalculated ETag support might be a nice feature.
Hugo Leisink
31 March 2014, 08:57
An alternative could be to hash the complete filename + filesize + last change date and use that for the Etag. How about that?
This topic has been closed.