1

I have a website with some images sent from php script. Every time ETag is sent and checked with next request. That works fine. On first page open all files are downloaded with 200 Ok and with the next with 304 Not Modified.

But I noticed that some file sent directly from http server are event not checked for beeing modified if I re-open the page but are while reloading (F5).

If I open the page for the first time:
Files from web server: 200 Ok
Files from php script: 200 Ok

If I press F5:
Files from web server: 304 Not Modified
Files from php script: 304 Not Modified

If I reopen the page:
Files from web server: NO REQUEST
Files from php script: 304 Not Modified

What I want to do is to make browser skip checking whether my files where modified or not and display the cached version. So I checked respones that http and php script are sending to browser:

Static content from http server:

Accept-Ranges        bytes
Connection           keep-alive
Content-Length       22033
Content-Type         image/png
Date                 Sat, 15 Mar 2014 10:42:06 GMT
Etag                 "523c1617-5611"
Last-Modified        Fri, 20 Sep 2013 09:32:07 GMT
Server               nginx

Content served by php script:

Connection          keep-alive
Content-Type        image/jpeg
Date                Sat, 15 Mar 2014 10:45:16 GMT
Etag                c4ca4238a0b923820dcc509a6f75849b
Server              nginx
Transfer-Encoding   chunked

So the differences are:

Accept-Ranges, Content-Length, Last-Modified, Transfer-Encoding

But the only one which I THINK could make browser not check for update is Last-Modified. So if I add Last-Modified to my php script - would browser skip checking for update?

peku33
  • 3,628
  • 3
  • 26
  • 44

1 Answers1

0

Ok, found an anwser.

Last-Modified: with firefox made image-loading something like random.

Cache-Control: max-age=... completly stopped checking whether image was modified

peku33
  • 3,628
  • 3
  • 26
  • 44