简体   繁体   中英

PHP cache_lite apply in images

I am developing a website and the images from the websites should come from different 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM