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

前端 未结 6 2001
一整个雨季
一整个雨季 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 08:52

    Your response headers include Cache-Control: no-store, no-cache; these prevent caching.

    Remove those values (I think must-revalidate, post-check=0, pre-check=0 could/should be kept – they tell the browser to check with the server if there was a change).

    And I would stick with Last-Modified alone (if the changes to your resources can be detected using this criterion alone) – ETag is a more complicated thing to handle (especially if you want to deal with it in your PHP script yourself), and Google PageSpeed/YSlow advise against this one too.

提交回复
热议问题