Re: More efficient thumbnail script
| From: | Curt Zirzow | Date: | Wed, 17 Jan 2007 18:51:28 +0000 |
| Subject: | Re: More efficient thumbnail script | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247247@lists.php.net to get a copy of this message | ||
On 1/16/07, Jochem Maas <jochem@iamjochem.com> wrote:
Curt Zirzow wrote: On 1/16/07, Jochem Maas <jochem@iamjochem.com> wrote: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'].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?)...if ($cacheState) { $headers = getallheaders(); if (isset($headers['If-Modified-Since']) &&($headers['If-Modified-Since'] == $lastModified)) {
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.