我需要对外部图像使用浏览器缓存,这些图像的url不以扩展名结尾
图像url如下所示http://website.com/?imageId=45454
我有下面的appengine-web.xml,但是每次都从网站加载图像
<static-files>
<include path="http://website.com/*" expiration="7d" />
<include path="/**.gif" expiration="7d" />
<include path="/**.png" expiration="7d" />
<include path="/**.jpg" expiration="7d" />
<include path="/**.ico" expiration="7d" />
<include path="/**.js" expiration="7d" />
<include path="/**.css" expiration="1d" />
<include path="/robots.txt" expiration="7d"/>
<include path="http://fonts.googleapis.com/css?family=Questrial" expiration="7d"/>
<include path="http://fonts.googleapis.com/css?family=Open+Sans:400,600" expiration="7d"/>
</static-files>
最佳答案
不能在appengine-web.xml设置中执行此操作。相反,您应该指示处理该请求的servlet在返回图像时在响应上设置正确的头,告诉浏览器该图像是可缓存的。