Chrome doesn't cache images/js/css

后端 未结 6 1844
旧时难觅i
旧时难觅i 2020-11-27 03:23

When Chrome loads my website, it checks the server for updated versions of files before it shows them. (Images/Javascript/CSS) It gets a 304 from the server because I never

6条回答
  •  遥遥无期
    2020-11-27 03:50

    Wow! I was facing the same issue for quite some time.

    I'll tell you why you were facing this issue. Your headers are just fine. You receive a 304 because of the way you are trying to refresh the page. There a mainly 3 ways -

    1. Press enter in the address box. You will observe chrome reads the file from the cache first and does not go to the server at all.

    2. Press f5, this would verify if the file has become stale (probably that is how you are refreshing)

    3. Press Ctrl+f5, this is unconditional reload of all static resources.

    So basically - you should press the return key in the address bar. Let me know if this works.

提交回复
热议问题