Re: "If-Modified-Since" headers

From: Date: Wed, 29 Nov 2000 22:09:50 +0000
Subject: Re: "If-Modified-Since" headers
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-39643@lists.php.net to get a copy of this message
Attached is a patch I wrote which adds the If-Modified-Since checking I've been requesting. This is the first time I've ever cracked open the PHP source code, so there may be some mistakes. But so far in my tests, it's worked perfectly. Notes: 1) I'm using the ap_parseHTTPdate function from Apache to convert textual dates into time_t's. So it won't work with any other server at this time. 2) I compile PHP into Apache statically. I haven't tested this patch with PHP as a DSO.. Here's what it looks like in action! *** First request, with no If-Modified-Since: GET /lastmod.php HTTP/1.0 HTTP/1.1 200 OK Date: Wed, 29 Nov 2000 22:04:14 GMT Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1 X-Powered-By: PHP/4.0.3pl1 Last-Modified: Mon, 27 Nov 2000 00:00:00 GMT Connection: close Content-Type: text/html (body goes here) *** Second request, with an If-Modified-Since of the same date: GET /lastmod.php HTTP/1.0 If-Modified-Since: Mon, 27 Nov 2000 00:00:00 GMT HTTP/1.1 304 Not Modified Date: Wed, 29 Nov 2000 22:05:18 GMT Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1 X-Powered-By: PHP/4.0.3pl1 Connection: close Content-Type: text/html *** Third request, with an If-Modified-Since of the day before: GET /lastmod.php HTTP/1.0 If-Modified-Since: Mon, 26 Nov 2000 00:00:00 GMT HTTP/1.1 200 OK Date: Wed, 29 Nov 2000 22:07:59 GMT Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1 X-Powered-By: PHP/4.0.3pl1 Last-Modified: Mon, 27 Nov 2000 00:00:00 GMT Connection: close Content-Type: text/html (body goes here) Anyway, I hope this is helpful. (And merged into a future release ;) Jordan Russell

Attachment: [application/octet-stream] php-4.0.3pl1-ifmodsince.patch
« previous php.dev (#39643) next »