2012-04-27 79 views
0

对于在java/spring中创建的产品目录Web应用程序,它从第三方Web服务获取产品图像,在服务器端图像缓存的策略是什么?服务器端的图像缓存

谢谢。

回答

0

让您的网站创建指向本地托管页面的IMG参考。这个页面将执行以下操作:

if (the requested image does not exist in the local cache) { 
    go to the third party site and save it to the local cache 
} 
serve the image from the local cache 

根据图像的频率很可能会改变对第三方网站,你可能想补充一点,经常删除它们比X天的图像cron作业。

+0

Thanks.We坚持在MongoDB中的图像URL。但目前从第三方服务中获取实际图像。你是对的,最简单的缓存就像你提到的缓存。 – user724503 2012-04-30 09:38:38