473,748 Members | 8,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
13 1652
"Joerg Jooss" <ne********@joe rgjooss.de> wrote in message
news:xn******** ********@msnews .microsoft.com. ..
tshad wrote:
"Joerg Jooss" <ne********@joe rgjooss.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******** *****@TK2MSFTNG P15.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 (HttpCacheabili ty.NoCache);

(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.d e

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 (HttpCacheabili ty.NoCache);

(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.d e
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*****@discus sions.microsoft .com> wrote in message
news:54******** *************** ***********@mic rosoft.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
1346
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 ob_start and then save it as filename.htm (thus, effectively filename.htm is cached as static file on server hard disk) Every 10 minutes a cron job deletes filename.htm
0
1382
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 cases (I intend these to be used as, for example, getInstanceValueFunction = Memoize1(getInstanceValueFunction) within the DifferentCache class definition). Memoize1 will have problems with getMemberValueFunction b/c it will try to generate a...
0
1506
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 page they use "You are User1". User1 then then logs out. Then user2 log-in and is a valid user the next page they use however say "You are User1"
1
2141
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 development can be demonstrated to key users at particular points. However, when I access the application from my machine, I'm getting to odd caching behaviour that I dont understand. All the pages are being cached and I need to refresh each page to get...
2
1509
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 products catalogue and the products show in a datagrid in one of the user controls. This datagrid has many rows and columns of images and this is what I'm most interested in caching. If I put <%@ OutputCache Duration="500" VaryByParam="MenuID"...
1
1320
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 environment... Simple (I think!!) use of the Cache as below, BOSContext bosContext = new BOSContext(); StringBuilder Html = new StringBuilder();
0
1756
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 code works correctly. If there is no debugger it doesn't fire, which causes the app to have problems. Here's what the code does: The TemplateData class inherits from the DataSet Object, in the constructor it loads itself with Data from an XML...
2
6130
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 simply be a result of being out of memory.) We're running on IIS 5.1 on a single Windows 2000 server. We have a separate database server - SQL Server 2000 64 bit. Session state is stored on the database.
2
3158
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 items in the cache is synchronised so I don't get problems with setting/getting the same item at the same time?
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.