2012-04-27 203 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