How to detect if browser's cache is full

N

nsimeonov

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
 
E

Erwin Moller

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
 
J

Jessica Parker

Erwin Moller wrote:
I'm
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.
 
I

Ian Collins

Erwin said:
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.
 
J

Jessica Parker

Ian said:
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.

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.
 
R

Randy Webb

Jessica Parker said the following on 6/11/2006 11:02 PM:
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?
 
J

Jessica Parker

Randy said:
Jessica Parker said the following on 6/11/2006 11:02 PM:

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

Apparently I was wrong - the snobs are out in full blast eh?
 
B

Bart Van der Donck

Jessica said:
[...]
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">
 
R

Randy Webb

Jim Carlock said the following on 6/12/2006 7:54 PM:
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>
 
M

Michael Winter

That isn't necessarily true.

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).

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.

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
 
D

Dr John Stockton

JRS: In article <[email protected]>,
dated Tue, 13 Jun 2006 12:55:52 remote, seen in
news:comp.lang.javascript said:
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.
 
N

nsimeonov

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?
 
R

Richard Cornford

... 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.
 
N

nsimeonov

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 напиÑа:
 
R

Richard Cornford

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.
 
N

nsimeonov

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?
 
N

nsimeonov

Randy Webb напиÑа:
(e-mail address removed) said the following on 6/20/2006 4:22 PM:

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
 
R

Randy Webb

(e-mail address removed) said the following on 7/2/2006 3:29 AM:
Randy Webb напиÑа:

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top