473,699 Members | 2,701 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 1648
"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
1343
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
1377
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
1503
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
2138
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
1503
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
1316
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
1755
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
6117
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
3153
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
8686
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
8615
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
9033
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8911
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
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...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
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.