On 1/16/07, Jochem Maas <[EMAIL PROTECTED]> wrote:
Curt Zirzow wrote:
> On 1/16/07, Jochem Maas <[EMAIL PROTECTED]> wrote:
>> ...
>> if ($cacheState) {
>> $headers = getallheaders();
>> if (isset($headers['If-Modified-Since']) &&
>> ($headers['If-Modified-Since'] == $lastModified)) {
>
> I was waiting for this to be mentioned...
>
> I would use a more detailed approach: http://pastebin.ca/319054
could you clarify alittle? (beyond not using the apache specific getallheaders()
function - I chose to go that route because I never run on anything other than
apache)
is the value of $headers['If-Modified-Since'] identical to
$_SERVER['HTTP_IF_MODIFIED_SINCE'] or *can* they differ (i.e. would
it be stupid to assume that apache 'normalized' the modidfied-since string?)
they should be identical, the one thing, iirc, is that the
getallheaders() returns what exactly the client sent, so if the client
sent 'if-modified-since:' then the assoc array would be
$headers['if-modified-since'].
is my code borked or merely not covering a number of edge cases related
to older or more exotic browsers - my code does output 304 headers
at the right time AFAIHT.
As far as i can see nothing is wrong.
After looking at rfc2616 i dont know why there is that $http_size
thing going on in the code i posted; must be from a very early draft
of HTTP/1.0 (as noted by the date in my comment)
Forget i said anything.
Curt.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php