lighttpd中静态图片的expires.url配置

发布于 2024-07-26 00:58:26 字数 658 浏览 1 评论 0原文

我试图避免从我的网络应用程序中重复重新加载图像。 我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2024-08-02 00:58:26

这完全正常。 提供没有正文的 http 304 仍然比再次提供整个图像/文件要快得多。

thats completely normal. Serving a http 304 with no body is still a lot faster than serving the whole image/file again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文