Why browser does not send “If-None-Match” header?

前端 未结 6 1999
一整个雨季
一整个雨季 2020-12-24 08:20

I\'m trying to download (and hopefully cache) a dynamically loaded image in PHP. Here are the headers sent and received:

Request:

GET /url:resource/P         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 09:09

    This happened to me due to 2 reasons:

    1. My server didn't send etag response header. I updated my jetty web.xml to return etag by adding the following:

      
          etags
          true
      
      
    2. The URL I called was for xml file. When I changed it to html file, chrome started sending "if-none-match" header!

    I hope it helps someone

提交回复
热议问题