ETag and resource representations

Hubert A Le Van Gong <[email protected]> Tue, 13 Aug 2013 18:11:13 -0700
Newsgroups gmane.comp.web.services.rest
Message-ID <[email protected]>
Greetings,

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?

Maybe another way to ask the same question: should the ETag management solely be based on the resource or also influenced by other factors surrounding requests for it (e.g. policies etc.)?

Cheers,
Hubert