Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firefox no-cache not honored?

How does one force Firefox to not cache a response? We've tried:

response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setDateHeader("Expires", 0); // Proxies.

but in about:cache we still see:

Cache entry information
key:    http://myhost.my.domain.com:42133/ducc-servlet/timestamp
fetch count:    4
last fetched:    2013-03-04 09:21:40
last modified:    2013-03-04 09:12:53
expires:    1969-12-31 19:00:00
Data size:    24
file on disk:    none
Security:    This document does not have any security info associated with it.
Client:    HTTP
request-method:    GET
response-head:    HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 Cache-Control: no-cache, no-store, must-revalidate 
Date: Sun, 03 Mar 2013 14:12:57 GMT 
Expires: Sun, 03 Mar 2013 14:12:57 GMT 
Content-Length: 24 
Server: Jetty(7.4.4.v20110707)

00000000:  32  30  31  33  2e  30  33  2e  30  34  20  30  39  3a  31  32  2013.03.04 09:12
00000010:  3a  35  36  20  4d  6f  6e  0a                                  :56 Mon.

Thanks.

Lou.

like image 480
user2133121 Avatar asked May 19 '26 09:05

user2133121


1 Answers

Firefox will always (unless it runs out of space) store the data in its cache, so that it can do things like view source, save as, etc by just pulling the data from the cache. It might not use it for normal page loads, of course, if the data was set "no-cache".

If the data is no-store, it will put the cache entry in memory, not on disk, as requested.

like image 135
Boris Zbarsky Avatar answered May 22 '26 01:05

Boris Zbarsky