IE and Caching

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I am having a problem with IE on one machine where it will not work after
the first time on certain pages. It appears to be going to the cache all
the time. On other machines I don't have that problem.

If I delete temporary files, it will work the first time.

If I close the browser and then open it again it won't work correctly,
unless I do a refresh on each and every page.

If I am going to my 3rd page, which depends on data kept in my session that
was put there from my 2nd page, it won't work.

I only seem to have this problem in IE.

Mozilla doesn't have this problem.

What is causing this and how do I get around it?

Thanks,

Tom
 
Juan T. Llibre said:
How are you caching ?
Post the method you're using.

I'm not doing anything that I have set up, specifically.

Where do I look to see what is being done?

I assume it is not something that asp.net is doing or it would affect
Mozilla as well as IE (wouldn't it?).

Tom
 
tshad,

Check Caching settins in Tools>Options>Settings and make sure that it is
"Automatically" or "Every visit to page".
 
suresh_C# said:
tshad,

Check Caching settins in Tools>Options>Settings and make sure that it is
"Automatically" or "Every visit to page".
That was it.

It was set to never.

But how do I deal with the user that has it set to "Never". My problem is
that I need to make sure that the user always checks (except for the back
button).

Thanks,

Tom
 
re:
I assume it is not something that asp.net is doing or it would affect
Mozilla as well as IE (wouldn't it?).

Actually, if you're caching the wrong way,
it could affect some browsers and not others.

Many programmers try to use "pragma" or old ASP caching methods.

The correct way to *not* cache in ASP.NET,
so that all browsers respect that command, is to use :

Response.Cache.SetCacheability(HttpCacheability.NoCache)

That way, the page won't even be stored in the cache,
so you won't have to go and delete it manually.

It will *always* be the "first time", so it should *alsways* work.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
Juan T. Llibre said:
re:

Actually, if you're caching the wrong way,
it could affect some browsers and not others.

Many programmers try to use "pragma" or old ASP caching methods.

The correct way to *not* cache in ASP.NET,
so that all browsers respect that command, is to use :

Response.Cache.SetCacheability(HttpCacheability.NoCache)

Where does this go and do you put it in each page?

Tom
 
tshad,

We dont have access to this setting via Server, but
1) You can *request* browser and intermidiate proxy not to cache the page.
2) If you want a few pages must be passed through the server, attach random
number like current datetime to the form action. This will force all browser
to go to the server.
 
You can set it in the codebehind with that code.

If you are not using codebehind, you can set it as a
directive at the top of the page, after <%@ Page ... %>

i.e. :
<%@ Page Language="VB" %>
<%@ OutputCache Location="None" %>

or...

<%@ Page Language="C#" %>
<%@ OutputCache Location="None" %>




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
Back
Top