Well, this solves que question of tranferring big documents only to know the last modified date, and always making a GET request, which is nice. But if I understand correctly, the remote server must have the last-modifed header in order to this whole scheme work.
Gustavo -----Mensagem original----- De: Miles Elam [mailto:[EMAIL PROTECTED] Enviada em: ter�a-feira, 30 de mar�o de 2004 11:12 Para: [EMAIL PROTECTED] Assunto: Re: RES: RES: Cache and HTMLGenerator Gustavo Nalle Fernandes wrote: > Thanks for the code! It is indeed very simple! That?s why I like Cocoon :) > Regarding the Last-Modified header, the getLastModified() do work for GET >request, but the GET request >also brings the whole document and not just the headers. That?s why I was >observing the whole document being >transferred all the time. So what is the best scenario for the >HTMLGenerator? > FYI: Web browsers always send GETs. The difference being that they also send the header If-Modified-Since: ***some timestamp value *** with the timestamp value being the value they received on the first uncached request. If the page has not been modified, the server sends back a 304 status code instead of a 200 and no content. If the page has been modified since the specified timestamp, it sends back the normal 200 status with the page content. The same should work with any timestamp. I've just only ever ever seen it used with values previously sent with the server. This should solve your "two requests" problem. - Miles Elam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
