Re: ETag and resource representations
Hubert A Le Van Gong <[email protected]> Wed, 14 Aug 2013 11:59:34 -0700
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <[email protected]> |
Jan, Erik, Thanks for your responses; I was afraid you were going to say that (1 ETag per representation) :) In our case, the ecosystem is quite large (many nodes accessing millions of shared resources). Assigning 1 ETag to each representation of a resource not only multiplies the number of ETags to manage but it also complicates the invalidation process: instead of simply tracking changes to the bits of the canonical resource we also need to track updates to other part of the systems that may alter the view of the resource for a given node (e.g. policies linked to that resource etc.). Maybe we should look into weak validators and determine what semantic changes are acceptable... Cheers, Hubert On Aug 14, 2013, at 7:26 AM, Jan Algermissen <[email protected]> wrote: > > On 14.08.2013, at 16:23, Erik Wilde <[email protected]> wrote: > >> hello jan. >> >> On 2013-08-14 16:11 , Jan Algermissen wrote: >>> On 14.08.2013, at 03:11, Hubert A Le Van Gong <[email protected]> wrote: >>>> I have a question about associating ETag to resources in a REST-based architecture. >>>> Would you recommend associating a single ETag to the canonical (i.e. complete) resource or rather use a different ETag for each representations of said resource. >>>> For instance, if I consider a library (full of books) as a resource. The view of that resource (i.e. the list of books returned) may vary based on the age of the reader (or any other criteria). Should I consider one ETag for the library as a whole or should I create an ETag for each representation returned to each reader? >>> ETag applies to the representation. If the actual bytes of the representation differ the ETag must differ. >> >> that's correct for strong ETags (the default), but not the case for weak ETags (which a server can choose to use). > > Ahr yes, forgot these - thanks for point that out. > > For a deeper discussion: http://www.mnot.net/blog/2007/08/07/etags > > Jan > > >> >> http://tools.ietf.org/html/rfc2616#section-13.3.3 >> >> i'd say that weak ETags are mostly used to have ETags survive non-essential differences (hit counters are the canonical example). it would be interesting to hear whether services are using them for other purposes like the one hubert mentioned. >> >> cheers, >> >> dret. >> >> -- >> erik wilde | mailto:[email protected] - tel:+1-510-2061079 | >> | UC Berkeley - School of Information (ISchool) | >> | http://dret.net/netdret http://twitter.com/dret | >