【发布时间】:2023-04-08 18:54:02
【问题描述】:
对于在 java/spring 中创建的产品目录 web 应用程序,它从第三方 web 服务获取产品图像,在服务器端缓存图像的好策略是什么?
谢谢。
【问题讨论】:
标签: image caching server-side
对于在 java/spring 中创建的产品目录 web 应用程序,它从第三方 web 服务获取产品图像,在服务器端缓存图像的好策略是什么?
谢谢。
【问题讨论】:
标签: image caching server-side
让您的网站创建指向本地托管页面的 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 作业。
【讨论】: