Denne tråd blev arkiveret. Stil et nyt spørgsmål, hvis du har brug for hjælp.
How can I get Firefox 4 to detect and load the latest version of a web page automatically?
Since upgrading to Firefox 4 from Firefox 3, I've noticed that various pages I visit frequently
come up showing old versions of the page, so I have to press F5 to see the latest version.
I did not have to do this under Firefox 3--if the page was out of date, it loaded up the new one for me without making me refresh manually.
Looking through the support documentation, I see that in about:config, I could change browser.cache.check_doc_frequency to 1 to force it to check for a new version every time, but the default (3) *should* be detecting when pages are out of date--it is not.
I never changed that setting under Firefox 3, so presumably the default setting worked in that version of the browser. Did the default used to be 1? Or is the behavior for the setting "3" just not working the same way in Firefox 4?
Alle svar (6)
Further updates to the first of those pages have been detected and loaded correctly, so I wonder if this was some kind of issue with FF4 not being able to detect that pages cached under FF3 had been updated.
If so, hopefully when I update my comics tomorrow, the browser will catch the page updates correctly, and I'll be able to close this question.
I had to hit F5 to refresh one of the sites after updating it today, and it had been cached previously under FF4, so apparently it is not just a browser transition issue. But other pages that did not refresh correctly yesterday, immediately after I updated FF, have been refreshing correctly, even with essentially the same change: FF4 gave me the old version of sketchy.smbhax.com today when I'd updated the comic on the front page, but when I updated a different comic series on the front of smbhax.com, FF4 *did* give me the correct, updated version there.
Those sites have been using the ancient and not particularly encouraged "Pragma: no-cache" headers to try to control catching. On the chance that FF4 is not as tolerant of such shenanigans, I've now put 'Cache-Control: "must-revalidate"' in .htaccess files for the sites. When I upload new comics to the sites on Monday, I'll update here with a report on whether or not that cache control change has worked for FF4.
(EDIT: Sorry, have a bit more experimenting to do with the server-side HTTP cache-control headers--will update after a few more days of testing.)
Ændret af smbhax den
Since switching to proper HTTP cache-control headers on the server, Firefox has not failed to present me with the freshest version of those sites.
Those headers were not necessary in order for Firefox to do the same in previous versions of the browser--all it took previously was a meta-equiv "pragma" "no-cache" line in the page HTML. Firefox 4 doesn't seem to be supporting that old HTTP 1.0 instruction. Anyone browsing updating sites that still rely on pragma no-cache may have to press F5 to see the latest version of the page--unless perhaps they change their browser.cache.check_doc_frequency setting from the default; I did not test that.
Ændret af smbhax den
I found it annoying too.
I added this in the htaccess file : Header add cache-control "must-revalidate"
And it solved the problem.