304: Not modified and front end caching

前端 未结 6 676
慢半拍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:27

    This article will answer all your questions on caching

    I found that adding

    RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
    RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]
    

    To the bottom of my htaccess file (below all rewriterule) worked.

提交回复
热议问题