Our webapp will make API calls to retrieve images. These images can be cached for a reasonable period of time, as indicated in terms, so we do not need to click on other site servers with every page request.
I'm new to caching, but I just watched some Railscasts about some different methods. page caching, fragment caching, dynamic page caching. All of them help to reduce the number of requests and, consequently, the speed of the my application .
But how can I "cache" images from another site on my servers? What is the right way to do this? Are there any features for this purpose?
My attempt
- add a timestamp cache_outdates_atto my model Imageand set it to one month in the future. Whenever an image is loaded again, it updates the timestamp.
Then I will add a cronjob to check for obsolete images and then delete them.
source
share