Hi!
A patch for handling If-Modified-Since is attached to this e-mail. Maybe it could be useful.
I've only tested it with Mozilla 1.7.1 (with help from http://livehttpheaders.mozdev.org/). So additional tests would be fine.
New function rfc1123-date for generating a date string for http headers.
Function handle-if-modified-since wants a time and handles almost everything by itself. Checks against If-Modified-Since and returns a 304 return code if necessary.
You have to set the Last-Modified header by yourself because you don't know if you can produce some output at this point. See create-static-file-dispatcher-and-handler in html.lisp for an example.
I've improved create-static-file-dispatcher-and-handler by adding cache functionality with handle-if-modified-since and setting Last-Modified, and a simple check if the file exists. (==> 404 if not). You see that Last-Modified isn't set when the file doesn't exist.
Regards, Stefan
Hi!
On 2004-07-22 17:51:52, Stefan Scholl wrote:
- ;; Simple string compare is sufficient. See RFC 2616 14.25
- (when (and if-modified-since (equal if-modified-since time-string))
One word to the above: When you change from a newer to an older version it is still a modified version. So when you have to delete the newest entry from a database you want the visitors to see the remaining entries, even when they are older.
Regards, Stefan
Hi!
On 2004-07-22 17:51:52, Stefan Scholl wrote:
I've only tested it with Mozilla 1.7.1 (with help from http://livehttpheaders.mozdev.org/). So additional tests would be fine.
OK, tested with MS IE 6.0 and Opera 7.51. No problems. Nice 304 in the logfile.
The handling of return codes other than 200 in modlisp.lisp could emit less data for 304 (+http-not-modified+).
Regards, Stefan
On Fri, 23 Jul 2004 14:55:38 +0200, Stefan Scholl stesch@no-spoon.de wrote:
The handling of return codes other than 200 in modlisp.lisp could emit less data for 304 (+http-not-modified+).
I've added that.
Cheers, Edi.
On Thu, 22 Jul 2004 17:51:52 +0200, Stefan Scholl stesch@no-spoon.de wrote:
A patch for handling If-Modified-Since is attached to this e-mail. Maybe it could be useful.
Thanks, I've added it to 0.2.6.
(I wouldn't mind if you'd also send patches for the docs... :)
Cheers, Edi.
On 2004-07-24 02:09:47, Edi Weitz wrote:
On Thu, 22 Jul 2004 17:51:52 +0200, Stefan Scholl stesch@no-spoon.de wrote:
A patch for handling If-Modified-Since is attached to this e-mail. Maybe it could be useful.
Thanks, I've added it to 0.2.6.
(I wouldn't mind if you'd also send patches for the docs... :)
Uaaah! And I've forgotten to add the stuff to the exports in packages.lisp.
handle-if-modified-since is missing there. And rfc1123-date needs to be exported, too. People want so set their own Last-Modified.
Sorry, i've just tested it inside create-static-file-dispatcher-and-handler.
Oops, Stefan