Re: More efficient thumbnail script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Curt Zirzow wrote:
> On 1/16/07, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:
>> Curt Zirzow wrote:
>> > On 1/16/07, Jochem Maas <jochem@xxxxxxxxxxxxx> 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'].

given that there may be difference in capitalization and the fact that
getallheaders() is apache specific it seems to me that using
$_SERVER['HTTP_IF_MODIFIED_SINCE'] would be better (not to mention saving
a function call).

> 
>>
>> 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.

given enough time it's garanteed ;-)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux