Re: images doesn't seem to cache

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

 



Anders Thoresson wrote:
This code seems to work. Have I got it right?


No. I have not. Sometimes the images are viewed from the cache, just to get downloaded from the server again next time, just a minute later, when I try again.

My local development server is running IIS, my production server is running Apache. Where is the best place to look for If-Modified-Since? Is $_GET['If-Modified-Since'] a safe bet?
it won't be a php-parameter. Seen as the script isn't executed when the server decides it is the same as the cached version. So only if it deems not to be, then it runs the script, and when it does that, the script doesn't need to know anything about modified-since, because that checks has long since been passed.

This is all an issue between browser and server, and php can't interfere in between those. However, to do something about it, change the headers that you send abou caching. These are the pragma headers for HTTP/1.0 (?), and the Cache-Control headers in HTTP/1.1



//Anders

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