RE: Re: Re: Last-Modified Header

2009-06-11 Thread Jerome Louvel
://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com/ http://www.noelios.com De : Rob Heittman [mailto:rob.heitt...@solertium.com] Envoyé : mercredi 10 juin 2009 19:23 À : discuss@restlet.tigris.org Objet : Re: Re: Re: Last-Modified Header I can't imagine how

Re: Re: Re: Last-Modified Header

2009-06-11 Thread Rob Heittman
Heittman [mailto:rob.heitt...@solertium.com] *Envoyé :* mercredi 10 juin 2009 19:23 *À :* discuss@restlet.tigris.org *Objet :* Re: Re: Re: Last-Modified Header I can't imagine how the framework would be able to figure that out on its own without being able to examine the Representation

RE: Re: Re: Last-Modified Header

2009-06-11 Thread Jerome Louvel
Cool! This class definitely needs more tests and feed-back to be as perfect as possible when 2.0 RC1 goes out. Cheers, Jerome De : Rob Heittman [mailto:rob.heitt...@solertium.com] Envoyé : jeudi 11 juin 2009 16:06 À : discuss@restlet.tigris.org Objet : Re: Re: Re: Last-Modified Header

Re: Last-Modified Header

2009-06-10 Thread Jonathan Hall
Hi Sherif, For custom headers whatever name you give, entity.modificationDate, will be used. However, what you probably meant to do is use setModificationDate(new Date()) on the entity/response representation. ie. representation.setModificationDate(new Date()); Jon Sherif Ahmed wrote:

RE: Re: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Thanks Jon. What I am trying to accomplish is implementing the Last-Modified / If-Modified-Since logic. Where I would tag responses with a uniform Last-Modified header for all resources/representations and when a request comes in with a If-Modified-Since header I'd send appropriate HTTP 304

Re: Re: Last-Modified Header

2009-06-10 Thread Rob Heittman
Restlet provides the 304 plumbing for you. Just setModificationDate() on your Resource's returned Representation as Jon suggests. The GET headers returned from my Web site which calls this function are below. If you hit this resource with Firefox and watch it with Firebug as you refresh (which

RE: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Brilliant.. The more I use Restlet the more I am liking it indeed. Now does Restlet has a framework to take care of Gzip encoding results when the Request headers indicate that the request is from a client that supports this encoding (all modern browsers do) I've been trying to add

RE: Re: Re: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Cool, This works as you indicate. However implementing this way has a downside. Would be nice that the framework could take care of sending a 304 even without having to get a concrete Representation which has a date set. The idea is to avoid creating a Representation if the Resource has not

Re: Re: Re: Last-Modified Header

2009-06-10 Thread Rob Heittman
I can't imagine how the framework would be able to figure that out on its own without being able to examine the Representation ... chicken, egg, chicken, egg. Still, I understand the concern if Representations are expensive to generate. I wonder if the conditional logic fetches the entity body if