This project is read-only.

Etag on entries

Oct 16, 2008 at 2:59 PM
Edited Oct 16, 2008 at 7:31 PM
I can't find any reference on what is and isn't a valid etag for an entry. Are they just random digits? How long should an eTag be?
I think a simple way to generate eTags could be to generate a random string whenever an entry is created or updated. If this would not work, then an MD5 sum of the entry contents could be used. Or a string containing the SQL id and the last updated datetime.

Oct 17, 2008 at 4:41 AM
It can pretty much be anything that represents the state of the data.  On the file repository, I use MD5.  For sql, it would make sense to use a timestamp column on the entry table in the database.  Note, this timestamp should not be confused with the Edited or Updated properties on the entry as they don't necessarily represent state of the data.  For example, a minor edit, like updating the rating or an entry would not change the updated date.  There is more information about this in the AtomPub specs.
Oct 17, 2008 at 8:18 PM
Edited Oct 17, 2008 at 8:23 PM
The Rowversion SQL data type (formerly known as TimeStamp) is working Ok.
But I can't check in right now due to issues with Codeplex's SVN server.