If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

FireFox 3.x caching static files aggressively

RESOLVED INCOMPLETE

Status

()

Core
Networking: Cache
RESOLVED INCOMPLETE
7 years ago
5 years ago

People

(Reporter: hoover, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19

Static files (like css, js, png, jpg, ...) get cached and firefox 3.x
takes the files from cache forever, means over days and OS
restarts.


Reproducible: Always

Steps to Reproduce:
1. Open FF 3.x load a dynamic php-page that includes css and js - files
2. Change the css and js - files on the server (optional: restart server/serverOS)
3. Restart clientOS or shutdown client and wait for 1 to infinite days
4. Start client and open FF 3.x load that page again
Actual Results:  
The php-pages are retrieved from server, the css and js files are retrieved from cache. If functions and layouts in the php+css+js files are changed the whole page is unusable.
Only [STRG]+[F5] will load the new static files.

Expected Results:  
At least FF 3.x should check once a session or once a day if the static files have been changed.
FF 3.x should not cache the static files forever.

There are many hints for this. For example to add a version behind static files:
/css/foo.css?bar=1.0

This is ridiculous since there are rfc standards for that and a browser should
do this work, not the web-developer.

I can not understand why this ist a major problem since FF 3 cames out.
I can not understand why there is no solution for this bad behavior.
Please post the http header for those files ?
A http log with a previously cleared cache and a reload with enabled logging would be great.
https://developer.mozilla.org/en/HTTP_Logging
You can attach it using the "add an attachment" link above.
Component: General → Networking: Cache
Product: Firefox → Core
QA Contact: general → networking.cache
(Reporter)

Comment 2

7 years ago
Hello,

I apologise the late response, I am very busy at the moment. I had no
time to investigate it in deep.


1) With a cleared cache I can not reproduce it. It seems that the problem
occurs only after a certain period of caching.


2) After I have installed firebug it is also very difficult to reproduce
it on our server (I do not understand why). Nevertheless, at this time I
found a client in our LAN who used a old js file which was changed 3 (!)
weeks ago (FF 3.6.11).
I can only provide whats in apache's log for this client -> no GETs on
css+js. (so firefox even can not know that there was something changed).


3) I should also provide you the certian circumstances:

- We have a apache server in our LAN with many different applications on it.
- The server is called with http://192.168.10.6:12345/
- In the doc-root there is an app. (the first developed)
- All other app. are in subfolders.
- Because this thing is grown over years it is a very mess.
- We decided to get it somehow into one big app. But unfortunately with
  little progress.
- But we made a policy for new app. So they have to follow a certain
  filestructure with min. requirements.

Let me explain the file structure (in / is the main app)

/
-/css
--main.css
-/js
--main.js
-index.php

-/app2
--/css
---main.css
--/js
---main.js
--index.php

-/app3
--/css
---main.css
--/js
---main.js
--index.php

etc.

So there are many files and folders with identical names in the same
"domain" but unter different locations. Maybe this is the problem.


I will provide more information if i have more time for that.
> at this time I found a client in our LAN who used a old js file which was
> changed 3 (!) weeks ago

What HTTP headers is that JS file sending right now?  See comment 1.
(Reporter)

Comment 4

7 years ago
Not mod.:

GET /app1/js/main.js HTTP/1.1
Host: 192.168.10.6:12345
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: */*
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://192.168.10.6:12345/app1/
If-Modified-Since: Fri, 29 Oct 2010 09:20:57 GMT
If-None-Match: "6000000000557-182c-493bdf9e51457"

HTTP/1.1 304 Not Modified
Date: Fri, 29 Oct 2010 15:57:55 GMT
Server: Apache/2
Connection: Keep-Alive
Keep-Alive: timeout=5, max=99
Etag: "6000000000557-182c-493bdf9e51457"


mod.:

GET /app1/js/main.js HTTP/1.1
Host: 192.168.10.6:12345
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: */*
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://192.168.10.6:12345/app1/
If-Modified-Since: Fri, 29 Oct 2010 09:20:57 GMT
If-None-Match: "6000000000557-182c-493bdf9e51457"
Cache-Control: max-age=0

HTTP/1.1 200 OK
Date: Fri, 29 Oct 2010 16:03:42 GMT
Server: Apache/2
Last-Modified: Fri, 29 Oct 2010 16:03:22 GMT
Etag: "6000000000557-182e-493c39912fa8a"
Accept-Ranges: bytes
Content-Length: 6190
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: application/x-javascript


This headers were taken from the server, the particular
client mentioned in Comment 2 is a "roadwarrior" I have
no access at the moment.
But as I said, going through the apache log there is
no GET for main.js from the client.
OK.  So the server sends a Last-Modified and a Date, but no Expires or Max-Age.

In this situation, the HTTP spec says that the client should use a heuristic to determine the expiration time (that is, the time at which the client should next make a GET request instead of just reading from cache).

The heuristic we use is that the content is valid for a time equal to (Date - Last-Modified)/10 starting now.

In the example above, that would be for 2 seconds from the receipt of the response.  But for a file that hasn't been modified in 30 weeks, the validity period would be computed at 3 weeks.

So how long was that js file unmodified before being modified?
no response, please reopen if this still happens
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.