Why does Browser still sends request for cache-control public with max-age?

前端 未结 4 1138
余生分开走
余生分开走 2020-12-08 13:16

I have Amazon S3 objects, and for each object, I have set

Cache-Control: public, max-age=3600000

That is roughly 41 days.

And I hav

4条回答
  •  鱼传尺愫
    2020-12-08 13:45

    When you press F5 in Chrome, it will always send requests to the server. These will be made with the Cache-Control:max-age=0 header. The server will usually respond with a 304 (Not Changed) status code.

    When you press Ctrl+F5 or Shift+F5, the same requests are performed, but with the Cache-Control:no-cache header, thus forcing the server to send an uncached version, usually with a 200 (OK) status code.

    If you want to make sure that you're utilizing the local browser cache, simply press Enter in the address bar.

提交回复
热议问题