How to detect if browser's cache is full

Discussion in 'Javascript' started by nsimeonov@gmail.com, Jun 6, 2006.

  1. Guest

    Hello,

    Does anyone have any idea how Gmail does this? I have a web application

    and people complain sometimes about some problems and most of the time
    it turns out it's the browser's cache being full. The application
    doesn't do anything really fancy and all it does is to set a cookie. I
    did a search and couldn't find anything except people explainin how I
    shouldn't do that. Even if the users have to add the server to the
    trusted zone it's ok because it's an intranet application. btw. I'm
    speaking of a MS shop, so everyone is using IE if that matters. Even if

    Mozilla doesn't support that functionality or doesn't have any problems

    with it - I don't care at this point because my users are using IE
    99.9999% of the time and searching for bugs on places where they don't
    exist is wasting my time.

    Thanks,
    Nick
     
    , Jun 6, 2006
    #1
    1. Advertising

  2. Erwin Moller Guest

    wrote:

    > Hello,
    >
    > Does anyone have any idea how Gmail does this? I have a web application
    >
    > and people complain sometimes about some problems and most of the time
    > it turns out it's the browser's cache being full.


    What?
    What on Earth makes you think that 'problems' are caused by browsers cache
    that is full?
    I do not believe that explanation at all.
    Back up that claim with some proof.


    The application
    > doesn't do anything really fancy and all it does is to set a cookie. I
    > did a search and couldn't find anything except people explainin how I
    > shouldn't do that. Even if the users have to add the server to the
    > trusted zone it's ok because it's an intranet application. btw. I'm
    > speaking of a MS shop, so everyone is using IE if that matters. Even if
    >
    > Mozilla doesn't support that functionality or doesn't have any problems
    >
    > with it - I don't care at this point because my users are using IE
    > 99.9999% of the time and searching for bugs on places where they don't
    > exist is wasting my time.


    So why should I care and help you?
    I am that 0.00001% that uses Firefox.

    Like your first story: I do not believe this either.

    You know-it-all attitude doesn't reflect your actual knowledge.

    Regards,
    Erwin Moller

    >
    > Thanks,
    > Nick
     
    Erwin Moller, Jun 7, 2006
    #2
    1. Advertising

  3. Erwin Moller wrote:
    I'm
    > > speaking of a MS shop, so everyone is using IE if that matters. Even if
    > >
    > > Mozilla doesn't support that functionality or doesn't have any problems
    > >
    > > with it - I don't care at this point because my users are using IE
    > > 99.9999% of the time and searching for bugs on places where they don't
    > > exist is wasting my time.

    >
    > So why should I care and help you?
    > I am that 0.00001% that uses Firefox.
    >


    You're one of his users? What an amazing coincidence.

    To the OP: Sorry, I don't know how to help you, but I hope someone can
    without being a snob! Good luck.
    -A faithful firefox users who doesn't work for you.
     
    Jessica Parker, Jun 8, 2006
    #3
  4. Jessica Parker wrote:
    > -A faithful firefox users who doesn't work for you.


    Erg...*with* you.
     
    Jessica Parker, Jun 8, 2006
    #4
  5. Ian Collins Guest

    Erwin Moller wrote:
    > wrote:
    >
    >
    >>Hello,
    >>
    >>Does anyone have any idea how Gmail does this? I have a web application
    >>
    >>and people complain sometimes about some problems and most of the time
    >>it turns out it's the browser's cache being full.

    >
    >
    > What?
    > What on Earth makes you think that 'problems' are caused by browsers cache
    > that is full?
    > I do not believe that explanation at all.
    > Back up that claim with some proof.
    >

    Interesting aside, I was unable to login to my online banking account
    the other day. When I called the bank, the first thing they asked was
    "are you using Firefox?", when I said yes, the response was "your cache
    is full, clear the cache and restart". This cleared the problem.

    Unfortunately the help desk person was unable to explain why the problem
    occurs.

    --
    Ian Collins.
     
    Ian Collins, Jun 8, 2006
    #5
  6. Ian Collins wrote:
    > Erwin Moller wrote:
    > > wrote:
    > >
    > >
    > >>Hello,
    > >>
    > >>Does anyone have any idea how Gmail does this? I have a web application
    > >>
    > >>and people complain sometimes about some problems and most of the time
    > >>it turns out it's the browser's cache being full.

    > >
    > >
    > > What?
    > > What on Earth makes you think that 'problems' are caused by browsers cache
    > > that is full?
    > > I do not believe that explanation at all.
    > > Back up that claim with some proof.
    > >

    > Interesting aside, I was unable to login to my online banking account
    > the other day. When I called the bank, the first thing they asked was
    > "are you using Firefox?", when I said yes, the response was "your cache
    > is full, clear the cache and restart". This cleared the problem.
    >
    > Unfortunately the help desk person was unable to explain why the problem
    > occurs.
    >
    > --
    > Ian Collins.


    All browsers have cache...

    There is a meta tag to tell the browser NOT to cache a page.
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1"> (Add this second line for IE).

    Not sure if this would help with the original problem, but it took me
    two seconds to find on google.
     
    Jessica Parker, Jun 12, 2006
    #6
  7. Randy Webb Guest

    Jessica Parker said the following on 6/11/2006 11:02 PM:
    > Ian Collins wrote:
    >> Erwin Moller wrote:
    >>> wrote:
    >>>
    >>>
    >>>> Hello,
    >>>>
    >>>> Does anyone have any idea how Gmail does this? I have a web application
    >>>>
    >>>> and people complain sometimes about some problems and most of the time
    >>>> it turns out it's the browser's cache being full.
    >>>
    >>> What?
    >>> What on Earth makes you think that 'problems' are caused by browsers cache
    >>> that is full?
    >>> I do not believe that explanation at all.
    >>> Back up that claim with some proof.
    >>>

    >> Interesting aside, I was unable to login to my online banking account
    >> the other day. When I called the bank, the first thing they asked was
    >> "are you using Firefox?", when I said yes, the response was "your cache
    >> is full, clear the cache and restart". This cleared the problem.
    >>
    >> Unfortunately the help desk person was unable to explain why the problem
    >> occurs.
    >>
    >> --
    >> Ian Collins.

    >
    > All browsers have cache...
    >
    > There is a meta tag to tell the browser NOT to cache a page.
    > <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    > <META HTTP-EQUIV="Expires" CONTENT="-1"> (Add this second line for IE).
    >
    > Not sure if this would help with the original problem, but it took me
    > two seconds to find on google.


    How long did it take you to find the explanation of why those two meta
    tags are useless and futile to use?

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jun 12, 2006
    #7
  8. Randy Webb wrote:
    > Jessica Parker said the following on 6/11/2006 11:02 PM:
    > > Ian Collins wrote:
    > >> Erwin Moller wrote:
    > >>> wrote:
    > >>>
    > >>>
    > >>>> Hello,
    > >>>>
    > >>>> Does anyone have any idea how Gmail does this? I have a web application
    > >>>>
    > >>>> and people complain sometimes about some problems and most of the time
    > >>>> it turns out it's the browser's cache being full.
    > >>>
    > >>> What?
    > >>> What on Earth makes you think that 'problems' are caused by browsers cache
    > >>> that is full?
    > >>> I do not believe that explanation at all.
    > >>> Back up that claim with some proof.
    > >>>
    > >> Interesting aside, I was unable to login to my online banking account
    > >> the other day. When I called the bank, the first thing they asked was
    > >> "are you using Firefox?", when I said yes, the response was "your cache
    > >> is full, clear the cache and restart". This cleared the problem.
    > >>
    > >> Unfortunately the help desk person was unable to explain why the problem
    > >> occurs.
    > >>
    > >> --
    > >> Ian Collins.

    > >
    > > All browsers have cache...
    > >
    > > There is a meta tag to tell the browser NOT to cache a page.
    > > <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    > > <META HTTP-EQUIV="Expires" CONTENT="-1"> (Add this second line for IE).
    > >
    > > Not sure if this would help with the original problem, but it took me
    > > two seconds to find on google.

    >
    > How long did it take you to find the explanation of why those two meta
    > tags are useless and futile to use?
    >
    > --
    > Randy
    > comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    > Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


    Apparently I was wrong - the snobs are out in full blast eh?
     
    Jessica Parker, Jun 12, 2006
    #8
  9. Jessica Parker wrote:

    > > > [...]
    > > > There is a meta tag to tell the browser NOT to cache a page.
    > > > <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    > > > <META HTTP-EQUIV="Expires" CONTENT="-1"> (Add this second line for IE).

    >
    > Apparently I was wrong -


    Yes you are. And even if you were right, you forgot:

    <META HTTP-EQUIV="cache-control" CONTENT="no-cache">

    --
    Bart
     
    Bart Van der Donck, Jun 12, 2006
    #9
  10. Randy Webb Guest

    Jim Carlock said the following on 6/12/2006 7:54 PM:
    > Randy Webb wrote:
    >> How long did it take you to find the explanation of why
    >> those two meta tags are useless and futile to use?

    >
    > I'm interested in hearing what others have to say about
    > why it's useless and what makes it useless.


    The fact that it depends on a UA honoring something that it isn't
    required to honor at all.

    > Am I correct in leaning into the meta pragma cache tags as
    > something for proxy servers?


    Probably so, who knows. It became abused by people when they noticed
    that sometimes the browser/UA would honor it and didn't care if the UA
    didn't honor it. Then it became mythical to use it.

    > Search engines don't seem to honor those tags, so they don't seem
    > to apply to search engines, although they might provide a hint on
    > how many times the spiders should visit. <g>


    My browser doesn't honor it either <g>

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jun 13, 2006
    #10
  11. On 13/06/2006 00:54, Jim Carlock wrote:

    > "Jessica Parker" <> wrote:
    > Jessica Parker said the following on 6/11/2006 11:02 PM:
    >
    >> All browsers have cache...


    That isn't necessarily true.

    >> There is a meta tag to tell the browser NOT to cache a page.


    A meta element may be used to suggest that a browser should not cache a
    document, but caching is a HTTP mechanism and one should only expect
    cache control directives to be honoured if they are sent in the response
    headers (with the conditions explained in RFC 2616).

    >> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">


    The Pragma header is a relic from HTTP/1.0 and applied to proxy servers.
    In fact, it is a request header not a response header, therefore using
    it in this way is undefined.

    >> <META HTTP-EQUIV="Expires" CONTENT="-1"> (Add this second line for IE).


    The value of an Expires header is a date, the format of which is defined
    in RFC 1123 (and repeated for convenience in #2616). Though a user agent
    should be prepared to handle a malformed value, nothing should ever be
    written to send one: "an implementation must be conservative in its
    sending behavior, and liberal in its receiving behavior."

    > I believe browsers cache everything [...]


    They can, but a browser should honour (real) HTTP cache control
    directives unless the user explicitly sets preferences to override that
    behaviour. Even then, there are some directives that must always be
    honoured (at least if the implementation is conditionally or
    unconditionally conforming).

    In any case, it is rare (but not impossible) that disabling caching is a
    good solution to anything. Caching is a beneficial feature to authors,
    end-users, and the Internet at large. However, one must understand how
    caching works and how it can be properly controlled.

    [snip]

    > I'm interested in hearing what others have to say about
    > why [meta elements are] useless and what makes it useless.


    As I wrote above, caching is a feature of HTTP, not HTML. One cannot
    expect /any/ user agent, especially intermediate caches, to honour a
    directive that is present in markup.

    [snip]

    Mike

    --
    Michael Winter
    Prefix subject with [News] before replying by e-mail.
     
    Michael Winter, Jun 13, 2006
    #11
  12. JRS: In article <sByjg.85275$>,
    dated Tue, 13 Jun 2006 12:55:52 remote, seen in
    news:comp.lang.javascript, Michael Winter <>
    posted :
    >
    >The value of an Expires header is a date, the format of which is defined
    >in RFC 1123 (and repeated for convenience in #2616). Though a user agent
    >should be prepared to handle a malformed value, nothing should ever be
    >written to send one: "an implementation must be conservative in its
    >sending behavior, and liberal in its receiving behavior."



    It would be appropriate if exact ISO 8601:2004 (easily recognised) were
    to be added to the set of acceptable formats for Internet use.

    It would be nice if signed-integer, representing seconds since
    1970-01-01 00:00:00 GMT, were also added; and possibly, for use in
    limited circumstances, symbols for past, present, and future.

    xxxxxxxxxxxxxxxxxxxx

    Once upon a time, someone here or in the Microsoft Jscript group was
    interested in generating or checking ISBN check-digits.

    13-digit ISBNs are being introduced, to augment or supersede the
    10-character ones.

    <URL:http://www.merlyn.demon.co.uk/js-misc0.htm> now has code for
    generating and checking both sizes.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
    Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
    PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
    Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
     
    Dr John Stockton, Jun 14, 2006
    #12
  13. Guest

    Guys guys, we're getting way off topic... Does anyone have any idea how
    to find this in google's code? Any clue? I can't find anything
    searching the net.

    About expiration and meta-tags: I thought everyone stopped using these
    somewhere in the past 10 years. Expiration is done through the header
    and every script language has a way to set these headers (ok, there MAY
    be a language out there you may find that that has no way to do it but
    at least php, jsp, asp.net and asp have, so I don't care if an ancient
    version of Perl on a setup on HPUX from 1985 doesn't have it, it's
    irrelevant).

    And still expiration doesn't help - all the pages we're talking about
    are dynamic and expiring the very second they are downloaded and still
    the explorer's cache is getting full. Same with GMail however it keeps
    warning me about it.

    Any ideas?
     
    , Jun 20, 2006
    #13
  14. wrote:
    <snip>
    > ... Does anyone have any idea how to find this in google's
    > code? Any clue? I can't find anything searching the net.

    <snip>

    You cannot have been looking very hard as a quick google groups search
    turned up the one of the previously discussions on the subject, which
    explains that not even google are capable of detecting when a browser's
    cache is full and what they are probably doing instead.

    <URL:
    http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ce1ac46f82dfa7c9
    >


    Richard.
     
    Richard Cornford, Jun 20, 2006
    #14
  15. Guest

    Hi Richard,

    I found your explanation and ignored it, because what you are saying is
    that what google does is impossible and misleading and I should
    actually trust you and not my eyes eventhough when I see this message
    when I log on to gmail then I also figure out that other sites are
    suffering too. And we're not talking about downloading content that
    should be already stored on the local machine - on the contrary - the
    browser is showing OLD data - something stored in the cache some time
    ago and not downloading anything from the server.

    I was asking if someone actually heard about this technique because I
    don't have the time to reverse-engineer gmail just to figure out how
    they do that. I really want to be able to detect this situation and
    avoid frustration. Yes we included this in the FAQ but we still get
    calls from people who prefer to ask before they spend a few seconds
    thinking - like most of the people posting questions on the usenet when
    typing the same question in google will give you the answer in the
    first 2-3 results.

    Anyway thanks for your time, I hope some day I'll find the answer or
    someone will point it out, until then we will live with the FAQ.

    Regards,
    Nikolay


    Richard Cornford напиÑа:
    > wrote:
    > <snip>
    > > ... Does anyone have any idea how to find this in google's
    > > code? Any clue? I can't find anything searching the net.

    > <snip>
    >
    > You cannot have been looking very hard as a quick google groups search
    > turned up the one of the previously discussions on the subject, which
    > explains that not even google are capable of detecting when a browser's
    > cache is full and what they are probably doing instead.
    >
    > <URL:
    > http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ce1ac46f82dfa7c9
    > >

    >
    > Richard.
     
    , Jun 20, 2006
    #15
  16. wrote:
    > I found your explanation and ignored it, because what you
    > are saying is that what google does is impossible and
    > misleading


    That is not what I wrote. I described how google could be setting about
    gathering information that would be symptomatic of a browser's cache
    being full. I also pointed out because the observable/testable symptoms
    could be caused by other factors it would not be valid to conclude from
    them that the browser's cache actually was full, but only that it may
    appear to be. (That is the distinction between knowing what you are
    doing and only writing things that 'mostly work'.)

    > and I should actually trust you and not my eyes eventhough
    > when I see this message when I log on to gmail then I also
    > figure out that other sites are suffering too.


    So you don't see how google may observe symptoms that could be accounted
    for by a full browser cache occurring when you have a full browser cache
    and then make a statement that your browser cache is full and appear
    correct, but may also be making that statement when other factors a
    causing those symptoms and in those cases be incorrect in their claim.

    > And we're not talking about downloading content that
    > should be already stored on the local machine - on the
    > contrary - the browser is showing OLD data - something
    > stored in the cache some time ago and not downloading
    > anything from the server.

    <snip>

    Don't bet on that, google use various background loading techniques.

    Richard.
     
    Richard Cornford, Jun 21, 2006
    #16
  17. Guest

    So what you suggest is that I should try using some of the AJAX
    techniques to download something off the server and verify if it's
    content is what I expect at the current time and if not then I should
    assume the cache is full, right?
     
    , Jun 21, 2006
    #17
  18. Randy Webb Guest

    Randy Webb, Jun 21, 2006
    #18
  19. Guest

    Randy Webb напиÑа:
    > said the following on 6/20/2006 4:22 PM:
    > > Hi Richard,
    > >
    > > I found your explanation and ignored it

    >
    > And there is 99.99% of your problem.


    Again... you tell me not to dig into it. You say you have no idea how
    google actually do it just that it has something to do with the browser
    cache and what it actually requests from the server. THANK YOU VERY
    MUCH for the detailed guidelines and code example that does what I
    asked for.

    Ok that was too much of a black humor but I read carefully your
    explanations a number of times and there isn't anything about a clear
    solution. On the contrary - you say that people shouldn't actually try
    doing this and they shouldn't care because it isn't anything standart
    and you actually don't like this sort of "hacking". And it doesn't work
    with every strange browser someone might write one day reading the book
    "how to write a browser for dummies".

    Regards,
    Nikolay
     
    , Jul 2, 2006
    #19
  20. Randy Webb Guest

    said the following on 7/2/2006 3:29 AM:
    > Randy Webb напиÑа:
    >> said the following on 6/20/2006 4:22 PM:
    >>> Hi Richard,
    >>>
    >>> I found your explanation and ignored it

    >> And there is 99.99% of your problem.

    >
    > Again... you tell me not to dig into it.


    I said no such thing. You may want to pay more attention to who
    posts/says what.

    The answer to your question is in the explanation that you chose to
    ignore and, once again, that is 99.99% of your problem. Not reading the
    explanation given to you.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jul 4, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel R. Neff
    Replies:
    2
    Views:
    593
    bradley
    Jun 10, 2005
  2. Replies:
    1
    Views:
    176
    Ken Bloom
    May 28, 2007
  3. Replies:
    2
    Views:
    95
  4. Replies:
    0
    Views:
    510
  5. Edward Diener
    Replies:
    11
    Views:
    443
    Bart Van der Donck
    Oct 26, 2007
Loading...

Share This Page