HTTP “Expires” header does not work in Chrome

后端 未结 2 1779
深忆病人
深忆病人 2021-01-04 03:58

My system is Windows 7 x64, Chrome 20.0.1132.57 m.

In my HTTP response header, I have:

Cache-Control: public, max-age=1000
Expires: *some date*


        
相关标签:
2条回答
  • 2021-01-04 04:25

    Be carefull when you are testing. I noticed that in Chrome version 20 if I hit F5 to reload the page then in the network panel I see new requests. Hoewer if I place the cursor to the title bar, after the current page url, and hit enter, I get resources from cache, whitch header was set to cache.

    Also its better just use the max age. Max age and Expires is the same, but in max age you specify the duration.

    See this: http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/ Method 3 and Method 4.

    0 讨论(0)
  • 2021-01-04 04:33

    I had similar problem and I found out that if you make the request with a new chrome tab it will work.

    0 讨论(0)
提交回复
热议问题