473,396 Members | 1,997 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,396 software developers and data experts.

Turn off browser cache

A.M
Hi,

How can I disable the end-user's browser cache inside the Page_Load event?

Thanks,
Alan
Nov 18 '05 #1
4 1531
This code should do the trick:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"A.M" <no*****@online.nospam> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I disable the end-user's browser cache inside the Page_Load event?

Thanks,
Alan

Nov 18 '05 #2
A.M
Thanks for help,

Can I use them inside Application_BeginRequest in Global.aspx?

Alan


"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ur****************@tk2msftngp13.phx.gbl...
This code should do the trick:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"A.M" <no*****@online.nospam> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I disable the end-user's browser cache inside the Page_Load event?
Thanks,
Alan


Nov 18 '05 #3
Hi Alan,

It will be Ok to put Steve's code in Application_BeginRequest.

Luke

Nov 18 '05 #4
Steve C. Orr [MVP, MCSD] wrote:
This code should do the trick:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")


That is a myth.

OK, that's probably a harsh way to put it.

What it does is scare off HTTP 1.1 proxies and "upward-compatible" HTTP 1.0
proxies like squid. The browser itself can choose to ignore any of those
headers. Try Opera ;-)

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #5

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

Similar topics

21
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" ...
2
by: Ben | last post by:
Hi all, I have written a web server that listens for requests: class MyHandler(BaseHTTPRequestHandler): def do_GET(self): if (self.path)=='/': data=makeList() else:
1
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's...
3
by: Sergey Surkov | last post by:
Hello Does anybody know how to make FireFox to cache data that comes via XMLHttpRequest? Here is the issue I deal with: - On the web server (apache2) I have a static xml file test.xml - When I...
13
by: Rohit | last post by:
I need to turn off caching in my ASP.NET page. I have set the following code in Page Load event: Response.Cache.SetCacheability(HttpCacheability.NoCache) Still, sometimes the page is retreived...
4
by: Robert Strickland | last post by:
I wish to turn off browser caching through some meta tags. Note the following: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> <META...
21
by: nsimeonov | last post by:
Hello, Does anyone have any idea how Gmail does this? I have a web application and people complain sometimes about some problems and most of the time it turns out it's the browser's cache...
11
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...
6
by: ernesto.tejeda | last post by:
Hello, I have a couple of questions regarding the loading of .js files for the browser and would like anyone to point me wher to find the answer (or if you know the answer and tell me will do just...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.