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

前端 未结 6 2015
一整个雨季
一整个雨季 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

    Similar problem

    I was trying to obtain Conditional GET request with If-None-Match header, having supplied proper Etag header, but to no avail in any browser I tried.

    After a lot of trial I realize that browsers treat both GET and POST to the same path as a same cache candidate. Thus having GET with proper Etag was effectively canceled with immediate "POST" to the same path with Cache-Control:"no-cache, private", even though it was supplied by X-Requested-With:"XMLHttpRequest".

    Hope this might be helpful to someone.

提交回复
热议问题