473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Caching problems in IE

How do we handle Caching in IE?

It seems that my system works fine in Mozilla and Netscape when I make
changes.

But in IE the changes are not brought across when someone has been to the
site before. If they have been here before and hit the same page, the old
page is rendered which will cause errors as things that are expected with
the new changes are not being done, such as session cookies being created or
updated.

I understand you can handle caching from the web.config, but why is IE
having a problem and Mozilla not?

Thanks,

Tom
Nov 19 '05 #1
13 1625
maybe you should post a code sample of what you are experiencing

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uv*************@TK2MSFTNGP10.phx.gbl...
How do we handle Caching in IE?

It seems that my system works fine in Mozilla and Netscape when I make
changes.

But in IE the changes are not brought across when someone has been to the
site before. If they have been here before and hit the same page, the old
page is rendered which will cause errors as things that are expected with
the new changes are not being done, such as session cookies being created
or updated.

I understand you can handle caching from the web.config, but why is IE
having a problem and Mozilla not?

Thanks,

Tom

Nov 19 '05 #2
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
maybe you should post a code sample of what you are experiencing
How would I do that?

The problem is just that if I go to a page in IE and then makes some
changes - If I go to that same page, my browser will load the old version of
the page. If the old page was looking for something that is not there any
more, I would get an error. As soon as I hit the refresh button, the new
version of the page gets loaded and it works fine.

It is hard to show it - as it is dependent on you loading a page and them my
making a change that would cause it to fail if you re-ran it.

I only have that problem with IE.

Tom
--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uv*************@TK2MSFTNGP10.phx.gbl...
How do we handle Caching in IE?

It seems that my system works fine in Mozilla and Netscape when I make
changes.

But in IE the changes are not brought across when someone has been to the
site before. If they have been here before and hit the same page, the
old page is rendered which will cause errors as things that are expected
with the new changes are not being done, such as session cookies being
created or updated.

I understand you can handle caching from the web.config, but why is IE
having a problem and Mozilla not?

Thanks,

Tom


Nov 19 '05 #3
make sure the IE setting for "Check for newer version of stored pages" is set
to "Automatically", which is the default. For some bizarre reason people
sometimes change this setting to "Never" which leads to the behavior you are
describing.
"tshad" wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
maybe you should post a code sample of what you are experiencing


How would I do that?

The problem is just that if I go to a page in IE and then makes some
changes - If I go to that same page, my browser will load the old version of
the page. If the old page was looking for something that is not there any
more, I would get an error. As soon as I hit the refresh button, the new
version of the page gets loaded and it works fine.

It is hard to show it - as it is dependent on you loading a page and them my
making a change that would cause it to fail if you re-ran it.

I only have that problem with IE.

Tom

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uv*************@TK2MSFTNGP10.phx.gbl...
How do we handle Caching in IE?

It seems that my system works fine in Mozilla and Netscape when I make
changes.

But in IE the changes are not brought across when someone has been to the
site before. If they have been here before and hit the same page, the
old page is rendered which will cause errors as things that are expected
with the new changes are not being done, such as session cookies being
created or updated.

I understand you can handle caching from the web.config, but why is IE
having a problem and Mozilla not?

Thanks,

Tom



Nov 19 '05 #4
tshad wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
maybe you should post a code sample of what you are experiencing


How would I do that?


Dou you do anything in your code that prevents caching?

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #5
"idi_amin" <id*****@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
make sure the IE setting for "Check for newer version of stored pages" is
set
to "Automatically", which is the default. For some bizarre reason people
sometimes change this setting to "Never" which leads to the behavior you
are
describing.

In "Automatically" mode IE will check for new version of page only once per
session. For development purposes you should set "Every visit to the page"
mode.
Nov 19 '05 #6
"idi_amin" <id*****@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
make sure the IE setting for "Check for newer version of stored pages" is
set
to "Automatically", which is the default. For some bizarre reason people
sometimes change this setting to "Never" which leads to the behavior you
are
describing.
That's fine for me.

But I don't want this happening for people that are using my site as it will
not work correctly when I make changes to my pages.

Tom

"tshad" wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
> maybe you should post a code sample of what you are experiencing


How would I do that?

The problem is just that if I go to a page in IE and then makes some
changes - If I go to that same page, my browser will load the old version
of
the page. If the old page was looking for something that is not there
any
more, I would get an error. As soon as I hit the refresh button, the
new
version of the page gets loaded and it works fine.

It is hard to show it - as it is dependent on you loading a page and them
my
making a change that would cause it to fail if you re-ran it.

I only have that problem with IE.

Tom
>
> --
> Regards,
> Alvin Bruney
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> available at www.lulu.com/owc
> _________________________
>
>
> "tshad" <ts**********@ftsolutions.com> wrote in message
> news:uv*************@TK2MSFTNGP10.phx.gbl...
>> How do we handle Caching in IE?
>>
>> It seems that my system works fine in Mozilla and Netscape when I make
>> changes.
>>
>> But in IE the changes are not brought across when someone has been to
>> the
>> site before. If they have been here before and hit the same page, the
>> old page is rendered which will cause errors as things that are
>> expected
>> with the new changes are not being done, such as session cookies being
>> created or updated.
>>
>> I understand you can handle caching from the web.config, but why is IE
>> having a problem and Mozilla not?
>>
>> Thanks,
>>
>> Tom
>>
>
>


Nov 19 '05 #7
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
tshad wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
> maybe you should post a code sample of what you are experiencing
How would I do that?


Dou you do anything in your code that prevents caching?


That's what I am trying to find out.

How do I do this?

Thanks,

Tom
Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #8
Hi, maybe i wasnt clear:
if the user has setup their browser to behave in this way (so that it will
never check for new versions of pages), then your site in fact should behave
this way. This is a very non-standard browser setup and any user with this
setting will have problems with using websites in general, including Google,
etc, not just your site.

-idi_amin
"tshad" wrote:
"idi_amin" <id*****@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
make sure the IE setting for "Check for newer version of stored pages" is
set
to "Automatically", which is the default. For some bizarre reason people
sometimes change this setting to "Never" which leads to the behavior you
are
describing.


That's fine for me.

But I don't want this happening for people that are using my site as it will
not work correctly when I make changes to my pages.

Tom


"tshad" wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
> maybe you should post a code sample of what you are experiencing

How would I do that?

The problem is just that if I go to a page in IE and then makes some
changes - If I go to that same page, my browser will load the old version
of
the page. If the old page was looking for something that is not there
any
more, I would get an error. As soon as I hit the refresh button, the
new
version of the page gets loaded and it works fine.

It is hard to show it - as it is dependent on you loading a page and them
my
making a change that would cause it to fail if you re-ran it.

I only have that problem with IE.

Tom
>
> --
> Regards,
> Alvin Bruney
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> available at www.lulu.com/owc
> _________________________
>
>
> "tshad" <ts**********@ftsolutions.com> wrote in message
> news:uv*************@TK2MSFTNGP10.phx.gbl...
>> How do we handle Caching in IE?
>>
>> It seems that my system works fine in Mozilla and Netscape when I make
>> changes.
>>
>> But in IE the changes are not brought across when someone has been to
>> the
>> site before. If they have been here before and hit the same page, the
>> old page is rendered which will cause errors as things that are
>> expected
>> with the new changes are not being done, such as session cookies being
>> created or updated.
>>
>> I understand you can handle caching from the web.config, but why is IE
>> having a problem and Mozilla not?
>>
>> Thanks,
>>
>> Tom
>>
>
>


Nov 19 '05 #9
tshad wrote:
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
tshad wrote:
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eC*************@TK2MSFTNGP15.phx.gbl...
> maybe you should post a code sample of what you are experiencing

How would I do that?


Dou you do anything in your code that prevents caching?


That's what I am trying to find out.

How do I do this?


Either set the OutputCache directive on your page(s)

<%@ OutputCache Location="None" %>

or set the Cache property of the HttpResponse in your code-behind class:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

(which is equivalent to the directive shown above)

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #10
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
tshad wrote:
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
> tshad wrote:
>
>> "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
>> news:eC*************@TK2MSFTNGP15.phx.gbl...
>> > maybe you should post a code sample of what you are experiencing
> >
>> How would I do that?
>
> Dou you do anything in your code that prevents caching?
That's what I am trying to find out.

How do I do this?


Either set the OutputCache directive on your page(s)

<%@ OutputCache Location="None" %>

or set the Cache property of the HttpResponse in your code-behind class:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

(which is equivalent to the directive shown above)


I'll go ahead and try that. That sounds like that will solve my problem.

I can't run the site assuming the user will have his browser set up a
certain way and I would have no way to know if his bowser is caching the
pages (although I suspect there probably is a way to check this). I don't
want him getting errors because of his caching.

Thanks,

Tom. Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #11
tshad wrote:

[...]
Either set the OutputCache directive on your page(s)

<%@ OutputCache Location="None" %>

or set the Cache property of the HttpResponse in your code-behind
class:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

(which is equivalent to the directive shown above)

I'll go ahead and try that. That sounds like that will solve my
problem.


Not fully. Browser histories are *not* caches, so in theory, none of
those HTTP headers apply. Actually, most browsers do treat histories as
caches, so they work.

I can't run the site assuming the user will have his browser set up a
certain way and I would have no way to know if his bowser is caching
the pages (although I suspect there probably is a way to check this).
I don't want him getting errors because of his caching.


You have to handle this in your web application. There's no way around
that. You must not blindly assume that a certain state exits when
executing any of your pages.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #12
"tshad" wrote:
I'll go ahead and try that. That sounds like that will solve my problem.

I can't run the site assuming the user will have his browser set up a
certain way and I would have no way to know if his bowser is caching the
pages (although I suspect there probably is a way to check this). I don't
want him getting errors because of his caching.


Hi, keep in mind that while there are techniques which can be used to try to
handle caching, they cannot be guaranteed to work for all users either, based
on their settings and browsers. The solution using the directive will
probably work for most of your users, however, and is probably "good enough".
Also keep in mind that this will degrade the performance of your pages
which use this technique. If your pages are not dynamic and only change once
in a while (new content every few days, etc), then it may not be worth
slowing down the experience for all users, just to make happy the few people
who use this non-standard browser setting.

You have to bite the bullet and make certain assumptions about how a browser
is setup. If you still deny this, are you going build your site to also
support users who have disabled javascript and cookies in their browser?
There are probably many more of those than who have set their browser cache
to never check for new pages. While its certainly possible to design your
site to handle these types of users, you need to ask yourself if its worth
it, or if you maybe should have clearly defined the baseline requirements
during early development. Otherwise you are headed down a very slippery
slope of spending all your time supporting a tiny percentage of users, at the
expense of most of your users.
Nov 19 '05 #13
"idi_amin" <id*****@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
"tshad" wrote:
I'll go ahead and try that. That sounds like that will solve my problem.

I can't run the site assuming the user will have his browser set up a
certain way and I would have no way to know if his bowser is caching the
pages (although I suspect there probably is a way to check this). I
don't
want him getting errors because of his caching.
Hi, keep in mind that while there are techniques which can be used to try
to
handle caching, they cannot be guaranteed to work for all users either,
based
on their settings and browsers. The solution using the directive will
probably work for most of your users, however, and is probably "good
enough".
Also keep in mind that this will degrade the performance of your pages
which use this technique. If your pages are not dynamic and only change
once
in a while (new content every few days, etc), then it may not be worth
slowing down the experience for all users, just to make happy the few
people
who use this non-standard browser setting.


In my case, the site is dynamic and all the pages are created on the fly
based on users input and the Sql that is generated. Rarely will someone get
the same page.

You have to bite the bullet and make certain assumptions about how a
browser
is setup. If you still deny this, are you going build your site to also
support users who have disabled javascript and cookies in their browser?
There are probably many more of those than who have set their browser
cache
to never check for new pages. While its certainly possible to design
your
site to handle these types of users, you need to ask yourself if its worth
it, or if you maybe should have clearly defined the baseline requirements
during early development. Otherwise you are headed down a very slippery
slope of spending all your time supporting a tiny percentage of users, at
the
expense of most of your users.


I agree.

But I have to deal with the odd time that someone will use a cached page
that does not correspond with the page on the server or the database.

Tom
Nov 19 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: siliconmike | last post by:
I've configured apache to fetch filename.htm if user requests filename.htm. But if filename.htm does not exist, apache will call index.php. Now, index.php will generate a page, buffer it using...
0
by: Mark E. Fenner | last post by:
In the code below, the class DifferentCache utilizes three different memoization (caching) strategies. Neither the function Memoize1 or the class Memoize2 will be adequate for all three of these...
0
by: jawahar Rajan | last post by:
All, I have a default setting of Response.Expires = 1200 is this 20 minutes? or 1200 minutes? The problem I have is say user1 log-in to the web site, and is a valid user, then I display on each...
1
by: CJM | last post by:
I'm working on an ASP application on my XP m/c. I've uploaded a copy of the ASP code and accompanying DB onto another server that is running both IIS5 & SQL Server. This is so that the...
2
by: moondaddy | last post by:
My default page stays constant in the site and all the content in the body of the page is produced with user controls in a table cell for the body section. The main function of this site is a...
1
by: Gavin Pollock | last post by:
Is anyone using Caching (HttpRuntime.Cache) in Whidbey? Not sure if there's another newsgroup for this though since it's still beta.... I'm having issues running a system built on 1.1 in a 2.0...
0
by: Rick Hein | last post by:
I've got a problem with an app I've been working on, the Caching object and events not firing correctly. In a nutshell: When I'm debugging, and I set a breakpoint in the removed item call back, the...
2
by: George1776 | last post by:
All, I've recently upgraded our production ASP.NET/C# application from framework 1.1 to 2.0. Since then I've been plagued by out-of-memory errors and problems with the cache object (which may...
2
by: Peter | last post by:
Hi The documentation for System.Web.Caching.Cache states that it is "thread safe". Does this mean that if I access System.Web.Caching.Cache from several places in my application access to the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.