Using Apache as cache server for images from third-part server

70 views Asked by At

I’m looking to run Apache as a cache server for static images. If requited image is missed locally on the server the server should download it from the third-part server and store it locally prior to responding to the request.

So when client sends request http://myserver/static/images/image1.jpg and the image is missed locally (i.e /var/www/static/images/image1.jpg is missed) the server

  1. Download the image from the another server http://third-partserver/static/images/image1.jpg
  2. Store it locally at /var/www/static/images/image1.jpg
  3. Return the image to the client

Is there any way to make it possible by using existed Apache modules and configurations only without writing any specific code?

0

There are 0 answers