lighttpd中静态图片的expires.url配置
我试图避免从我的网络应用程序中重复重新加载图像。 我使用 lighttpd 来提供静态内容,并且我的配置已过期,如下所示:
expire.url = ( "/static/" => "access 1year", " /static/images/" => "访问 1 年")
这似乎适用于位于 /static 的 js 和 css。
但这对于图像文件实际上不起作用 - 浏览器似乎仍然一遍又一遍地请求它们,收到“304 Not Modified”响应。
有人帮忙吗?
相关信息:
**ResponseHeaders:**
Expires : Tue, 22 Jun 2010 13:07:38 GMT
Cache-Control : max-age=31104000
Last-Modified : Thu, 25 Jun 2009 13:00:11 GMT
Date: Sat, 27 Jun 2009 13:07:38 GMT
**RequestHeaders**:
If-Modified-Since:Thu, 25 Jun 2009 13:00:11 GMT
Cache-Control:max-age=0
I am trying to avoid repeated re-loading of images from my web app.
I use lighttpd to serve the static content, and I have expired configured like so:
expire.url = ( "/static/" => "access 1 years", "/static/images/" => "access 1 years")
This seems to be working for js and css, who live in /static.
But this does not really work for image files - it seems that the browser still requests them over and over again, receiving a '304 Not Modified' response.
Help anyone?
Relevant info:
**ResponseHeaders:**
Expires : Tue, 22 Jun 2010 13:07:38 GMT
Cache-Control : max-age=31104000
Last-Modified : Thu, 25 Jun 2009 13:00:11 GMT
Date: Sat, 27 Jun 2009 13:07:38 GMT
**RequestHeaders**:
If-Modified-Since:Thu, 25 Jun 2009 13:00:11 GMT
Cache-Control:max-age=0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这完全正常。 提供没有正文的 http 304 仍然比再次提供整个图像/文件要快得多。
thats completely normal. Serving a http 304 with no body is still a lot faster than serving the whole image/file again.