How to force a web browser to cache Images

后端 未结 3 1834
梦谈多话
梦谈多话 2020-12-03 01:14

I am writing a small application which serves images from the local computer, so they can be accessed as http://localhost:12345/something/something (which returns a jpeg). <

3条回答
  •  广开言路
    2020-12-03 01:46

    A Last-Modified and Expires header might also be useful additions.

    Your server should also check for requests featuring an If-Modified-Since header, and return a 304 Not Modified response if possible to speed things along.

提交回复
热议问题