我需要使用浏览器缓存来处理具有不以扩展名结尾的网址的外部图片
图片网址看起来像这个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>
答案 0 :(得分:1)
您无法在appengine-web.xml设置中执行此操作。相反,您应该指示处理此请求的servlet在返回图像时在响应上设置正确的标头,告诉浏览器该图像是可缓存的。