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
- Download the image from the another server http://third-partserver/static/images/image1.jpg
- Store it locally at /var/www/static/images/image1.jpg
- 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?