homepage Welcome to WebmasterWorld Guest from 54.204.168.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
Caching in Firefox
Doesn't quite obey cache-control
ggrot

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 21 posted 6:40 pm on Feb 14, 2006 (gmt 0)

I'm trying to set up cache-control for a static page. I want to make sure that the user who views this page multiple times hits their browser cache every time.

I set two headers when returning the page:

Cache-Control: max-age=86400,public
-and-
Expires: Wed, 15 Feb 2006 18:33:40 GMT

The expires header is explicitly set to be 3 days in the future. I'm testing this out with the server and client having a synced clock (or close enough).

These two headers *should* prevent firefox from making a GET request for the page for 24 hours after the first get. I know I can also make use of the If-Modified-Since headers, but there is still a round trip to the server to use those - introducing unneeded latency.

Now, I understand that if the user explicitly refreshes the page, that firefox should issue GET requests anyway. Thats fine. But I notice that firefox also seems to issue GET requests for every *other* request that the user makes of that file.

1. load static.html -> GET resource, server returns
2. load static.html -> Firefox cache hit
3. load static.html -> GET resource, server 304 (Not Modified)
4. load static.html -> Firefox cache hit
5. load static.html -> GET resource, server 304 (Not Modified)

This continues indefinitely. Is this a bug in firefox? Is there some way I can convince firefox to make a cache hit every time?

 

Clinton Labombard

5+ Year Member



 
Msg#: 21 posted 7:07 pm on Feb 14, 2006 (gmt 0)

Similar problem here. If I update an image that's already in cache the cache has to be flushed before the updated image is shown. On IE6 I can set pages to be checked whenever they're loaded, but normally I have to do a double refresh before the updated images is shown.

ggrot

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 21 posted 7:15 pm on Feb 14, 2006 (gmt 0)

Actually, I have the inverse problem. I want the browser to use the static page *always*, ideally even if they hit refresh.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved