問題描述
lighttpd 中靜態圖片的 expires.url 配置 (expires.url configuration for static images in lighttpd)
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
‑‑‑‑‑
參考解法
方法 1:
thats completely normal. Serving a http 304 with no body is still a lot faster than serving the whole image/file again.
(by gnosis、lifeofguenter)