Hi Stian, We haven't forgotten about your suggestion, just dealing with a long email backlog :)
It is perfectly possible to optimize the internal algorithm so that getRepresentation(Variant) is never called when the variant's tag matches the one provided by the client. I've entered a RFE to keep track of it: http://restlet.tigris.org/issues/show_bug.cgi?id=319 As it changes the observed behavior a bit, it should only go in Restlet 1.1, IMHO. Best regards, Jerome > -----Message d'origine----- > De : Stian Soiland [mailto:[EMAIL PROTECTED] > Envoyé : mercredi 6 juin 2007 11:23 > À : [email protected] > Objet : Re: Conditional GETs? > > > On 4 Jun 2007, at 15:53, Peter Lacey wrote: > > > public Representation getRepresentation(Variant variant) { > > Representation result = null; > > > > if (variant.getMediaType().equals(MediaType.APPLICATION_XML)) { > > > > // create DOM > > > > result = new DomRepresentation(MediaType.APPLICATION_XML, > > doc); > > result.setTag(new Tag([your etag], false)); > > } > > return result; > > } > > It's really clever, except you still have to create that XML > representation that never needs to be sent out. > > If there was some getTag() method or something you could override > this to check directly with the database on whatever you need to > calculate the tag, and hence getRepresentation() wouldn't even need > to be called. > > To support this I think some kind of getLastModified() would also be > cool. (I've made such a thing in my subclass of Resource) > > -- > Stian Soiland, myGrid team > School of Computer Science > The University of Manchester > http://www.cs.man.ac.uk/~ssoiland/ >

