1
votes

While testing the webapp I am working on, I have noticed that firefox seems to be ignoring the cache header for user images.

All such images are loaded through a PHP script, here is a sample response:

Cache-Control: private, max-age=0
Connection: Keep-Alive
Content-Disposition: inline; filename="Immagine.jpg"
Content-Encoding: gzip
Content-Length: 33103
Content-Type: image/jpeg
Date: Thu, 16 Mar 2017 15:24:39 GMT
Etag: allegato-4f04349dba5b5f636a439af71ed75109b701a01d6ac5dfc287dee9729ce4e2098b02e39a2d673789213f5fdf20ceb21a0fc26f17e93e602e38238c3681b9bd00
Expires: Fri, 16 Jun 2017 16:24:40 +0200
Keep-Alive: timeout=5, max=100
Last-Modified: Tue, 16 Jul 2013 10:18:04 +0200
Server: Apache
Vary: Accept-Encoding

and here are the relevant parts of the request sent by firefox:

Host: mywebapp.local
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

I think the issue might be due to FF sending those Pragma and Cache-Control headers, however I checked multiple times and I have caching enabled.

The "same" request on Chrome, which caches correctly, looks like this:

Accept:image/webp,image/*,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
DNT:1
Host:mywebapp.local
If-Modified-Since:Tue, 16 Jul 2013 10:18:10 +0200
If-None-Match:allegato-4f04349dba5b5f636a439af71ed75109b701a01d6ac5dfc287dee9729ce4e2098b02e39a2d673789213f5fdf20ceb21a0fc26f17e93e602e38238c3681b9bd00
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

How can I determine if this issue is related to my own browser, or rather to the webapp itself?

1
about "I checked multiple times and I have caching enabled." you also have to uncheck the Disable HTTP Cache when toolbox is open option (which is checked by default) in the "Toolbox Options" (the panel on ctrl+shift+i ). I guess you did this as well, right?nikos.svnk
I didn't know of that switch D: and it was in fact the culprit of the problem... I am now in doubt whether just delete this question or self-answer.Matteo Tassinari
or I can make it an answer and you can accept it afterwards :)nikos.svnk
Seems fair, go on!Matteo Tassinari

1 Answers

2
votes

On Firefox there is one more switch that you have to uncheck in order to disable Cache when the Toolbox is open. You open the Toolbox (Ctrl+Shift+i), navigate to Toobox Options, and uncheck the Disable HTTP Cache when toolbox is open which by default is checked