304: Not modified and front end caching

前端 未结 6 657
慢半拍i
慢半拍i 2020-12-13 15:56

I am using a PHP script to serve files. I would like to be able to send back a 304 not modified header in my http response if the file has not changed since th

6条回答
  •  春和景丽
    2020-12-13 16:40

    I had this problem and it turned out to simply be that I had Firebug open. This has an option under the Net tab "Disable Browser Cache" that is ticked by default. There is a similar option in Chrome's developer tools, one of the tick boxes on the bar under the menu bar.

    Unticking these options resulted in the browser correctly sending HTTP_IF_MODIFIED_SINCE and everything working fine after all (even with Firebug or Chrome Dev Tools open).

提交回复
热议问题