Caching image requests through PHP - If-Modified-Since not being sent

前端 未结 5 1271
星月不相逢
星月不相逢 2021-01-13 08:33

I am serving images through php and having some problems setting it up to respond with 304 headers to save on load time.

Most of the code below I found on php.net. I

5条回答
  •  渐次进展
    2021-01-13 09:22

    After searching for a while, I've found the answer. The browser didn't cached anything (and didn't send the If-Modified-Since) until I sent the following header:

    Cache-Control: private;
    

    After doing this all worked fine.

提交回复
热议问题