I am developing a website and the images from the websites should come from different开发者_StackOverflow社区 server. It is good point that the images are in the different server but the server were the images are coming is too slow. Is there a way that I can cache the images coming from different server to my site. specially creating a physical images in my server in form of cache? Is PHP cache lite capable of doing that?
You seems to be looking to make a proxy, If I were you I won't do that with PHP or at least not only with PHP. Just install and use the apache caching capability.
I would make a php script that take as param an url and fetch it(nothing to funny just using curl).
Then I would setup apache to do some caching on the directory where you put the fetch script.
If you don't want to use apache you just have to add some code into the image fetcher like fetching the image if there is no cache or the cache is not expired. Cache lite would helps you to query and generate the cache.
精彩评论