is there a php library that implements caching for http downloads?
When downloading a document via http with the library, I would expect it to keep a copy of the document locally, and return the local copy at each subsequent call (for the same url) except if the remote file has changed. The library would use http headers to find out when the file has changed last.
Alternatively. Any suggestions how this could be implemented with a few lines of code?
thanks
Kurt
You can use curl, and look for the
304 Not Modifiedstatus header. Any cache to file, you would need to specify yourself (e.g where to store the file etc.)A quick google search for it gave me the following hit: http://www.lazycat.org/php-curl.php which appear to contain a working example.