473,804 Members | 3,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I urn off browser caching for all aspx pages?

Is there anyway within my web application that I can have all browser
caching turned off for all aspx pages sent by my IIS server? I need to have
all caching off in order for certain things to work properly, and I can't
always rely on the user disabling their cache settings at the browser level.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Nov 19 '05
12 1657
Great idea!

That will, in effect, act as a global directive since the
Application_Beg inRequest event is called in all requests.

Congratulations on your smart move!

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

"Ken Varn" <nospam> wrote in message news:O1******** ******@TK2MSFTN GP15.phx.gbl...
I tried another approach that seems to work, but please verify.

I modified the global.asax.cs file an added the
SetCacheability (HttpCacheabili ty.NoCache) call in the
Application_Beg inRequest event.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Or******** ******@tk2msftn gp13.phx.gbl...
I really hesitated before writing this, since tinkering
with basic functionality could have unexpected results.

You could try disabling the entire OutputCache module.

The OutputCache is a module which is added to ASP.NET's
core via a line in machine.config' s httpmodules section :
<httpModules>
<add name="OutputCac he" type="System.We b.Caching.Outpu tCacheModule" />

You could *experiment* removing that line.
You might have to make other adjustments, too.

Disclaimer: if you do this, you do it on your own behalf.
I do not accept any responsibility for unexpected results.

Good luck, if you decide to experiment with this.


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

"Ken Varn" <nospam> wrote in message

news:eS******** ******@TK2MSFTN GP12.phx.gbl...
> Thanks for all of the information on this post. I take it that there is no > global way to turn caching off for the entire ASP.NET application? It would > be nice if there was something in web.config where I could turn off caching > for the whole application.
>
> --
> -----------------------------------
> Ken Varn
> Senior Software Engineer
> Diebold Inc.
>
> EmailID = varnk
> Domain = Diebold.com
> -----------------------------------
> "Ken Varn" <nospam> wrote in message
> news:uv******** ******@TK2MSFTN GP10.phx.gbl...
>> Is there anyway within my web application that I can have all browser
>> caching turned off for all aspx pages sent by my IIS server? I need to
> have
>> all caching off in order for certain things to work properly, and I can't >> always rely on the user disabling their cache settings at the browser
> level.
>>
>> --
>> -----------------------------------
>> Ken Varn
>> Senior Software Engineer
>> Diebold Inc.
>>
>> EmailID = varnk
>> Domain = Diebold.com
>> -----------------------------------
>>
>>
>
>



Nov 19 '05 #11
Yunus Emre ALPÖZEN [MCAD.NET] wrote:
Use pragma no-cache


That's almost useless. Use true HTTP 1.1 features to prevent caching
(not that browsers need to honor them anyway).

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #12
Bruce Barker wrote:
note: these are all hints to the browser (and proxy servers) and may
be ignored.


True for browsers (unfortunately) , but proxies? The HTTP 1.1 spec has
MUST NOT written all over sections 14.9.1 and 14.9.2 ;-)
Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #13

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

Similar topics

21
3269
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" http://www.tonymarston.co.uk/php-mysql/backbuttonblues.html -- Tony Marston http://www.tonymarston.net
0
2139
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. After looking at the use of the OutputCache directive and tinkering with it a bit I found its usability.very limited. Think of it: it is okay for static content. Well that's nice but no big deal. Static content is cheap anyway, the file system...
0
1744
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little while to be processed. At the moment I have programmatic page caching in the "loader" using paramater caching to send a cached version of every requested page back to the user. How can I get particular elements inside each page to cache without...
10
1436
by: Jon Maz | last post by:
Hi, My goal is to take the entire html/javascript stream spat out by .aspx pages and save them as simple strings in a database (for caching purposes). I'm not sure how I can get hold of this html stream, though - does anyone have any strategies / code samples to get me going? Thanks,
3
1439
by: Joe Fallon | last post by:
I have a page in ASP.Net 1.1 which contains an image control. I set the ImageUrl property = "MyImageViewerPage.aspx" This page acts as an image handler. I have an array of bytes which I send to the browser using BinaryWrite. e.g. Response.ContentType = mVar.contenttype Response.BinaryWrite(mVar.MyBytes)
3
2947
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains say “www.Test1.com” and “www.Test2.com” pointing to a single website. Website content is located onto UNCPath i.e. remote location. Domain 1: www.Test1.com points to \\servername\websitefolder\homedirectory
11
12130
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> This tags are part of the <headelement. Sample code that I have seen shows how to add metatags of the form:
1
4877
by: Nalaka | last post by:
I had ..... <%@ OutputCache Duration="5000" Location="Server" VaryByParam="none" %> Then I added "browser" <%@ OutputCache Duration="5000" Location="Server" VaryByParam="none" VaryByCustom="browser" %> After I added browser... it stopped caching pages.... is there an explanation or... did I observe the problem wrong?
2
2847
by: =?ISO-8859-1?B?UOVsIEEu?= | last post by:
Have a "standard" asp.net web solution which uses the standard asp.net authentication and authorization methods (forms authentication). Some users have raised concern that even if you logout (which brings the user back to the login.aspx page) you can seemingly navigate back in via the back-button and the browser history. If user A is viewing a page and then clicks logout and leaves (browser not at login.aspx). User B comes along and...
0
9706
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
10575
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
10330
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
10319
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,...
1
7616
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
6851
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
5520
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...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.