[Jersey] ETag Best Practices

From: John Yeary <>
Date: Thu, 19 Jan 2012 09:58:34 -0500

Hello All,

I am trying to come up with some best practices for using ETag. I have been
using a hex conversion of the string and slicing off the first 13 digits,
and a MD5 hash of the the fields. The MD5 hash though seems a little
overkill. I thought about using a CRC32, or Adler hash.

The MD5 hash seems to collide with the HTTP 1.1 specification
Content-MD5[1] header which contains an MD5 hash of the entity.

I did a lot of searching on Google and found a number of different ideas,
but the majority had a hex hash of some sort. Can anyone share their ideas
and code?




John Yeary

<> <>

"Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits who
neither enjoy much nor suffer much, because they live in the gray twilight
that knows not victory nor defeat."
-- Theodore Roosevelt