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

Prevent Browser Caching for a Page

I have an ASP.NET page that spawns a popup window using
javascript's window.open. This works fine. It pops up,
you enter some data, press save and everything saves as
it should. But, if you click the button to open the
popup again, then it opens with the values that were in
it before the "save" was executed. I've determined that
the problem is that IE is storing the page in it's local
temporary internet files cache and isn't going to the
server to retrieve a fresh version. Is there something
that I can put in the html header to force IE to always
expire the page immediately?

Thanks!

Ian
Nov 17 '05 #1
5 3115
Hi Ian,

Based on my research and experience, There are two ways to instruct browser
not to use the copy in cache.

1. Add a meta data inside the <head> section. Please check the following
article for the details.

Prevent the browser from Caching a page
http://www.pacificnet.net/~johnr/meta.html
"...
This page is an explanation of using the Meta tag to prevent caching, by
browser or proxy, of an individual page wherein the page in question has
data that may be of a sensitive nature as in a "form page for submittal"
and the creator of the page wants to make sure that the page does not get
submitted twice.
..."

2. From server side, we can render the meta data via the Response object.
For example,

Response.Expires = -1

Please check the HttpResponse class for the detailed info

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #2
Hi Ian,

Based on my research and experience, There are two ways to instruct browser
not to use the copy in cache.

1. Add a meta data inside the <head> section. Please check the following
article for the details.

Prevent the browser from Caching a page
http://www.pacificnet.net/~johnr/meta.html
"...
This page is an explanation of using the Meta tag to prevent caching, by
browser or proxy, of an individual page wherein the page in question has
data that may be of a sensitive nature as in a "form page for submittal"
and the creator of the page wants to make sure that the page does not get
submitted twice.
..."

2. From server side, we can render the meta data via the Response object.
For example,

Response.Expires = -1

Please check the HttpResponse class for the detailed info

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #3
Hi Jacob,

I have a suggestion. For the next version of ASP.Net, include a property of
the Page class which can turn on or off Browser caching (by adding the
appropriate headers), and make it non-cached by default. I know of very few
situations in which ASP.Net pages SHOULD be cached by the browser.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Jacob Yang [MSFT]" <ji***@online.microsoft.com> wrote in message
news:fc*************@cpmsftngxa06.phx.gbl...
Hi Ian,

Based on my research and experience, There are two ways to instruct browser not to use the copy in cache.

1. Add a meta data inside the <head> section. Please check the following
article for the details.

Prevent the browser from Caching a page
http://www.pacificnet.net/~johnr/meta.html
"...
This page is an explanation of using the Meta tag to prevent caching, by
browser or proxy, of an individual page wherein the page in question has
data that may be of a sensitive nature as in a "form page for submittal"
and the creator of the page wants to make sure that the page does not get
submitted twice.
.."

2. From server side, we can render the meta data via the Response object.
For example,

Response.Expires = -1

Please check the HttpResponse class for the detailed info

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4
Hi Jacob,

I have a suggestion. For the next version of ASP.Net, include a property of
the Page class which can turn on or off Browser caching (by adding the
appropriate headers), and make it non-cached by default. I know of very few
situations in which ASP.Net pages SHOULD be cached by the browser.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Jacob Yang [MSFT]" <ji***@online.microsoft.com> wrote in message
news:fc*************@cpmsftngxa06.phx.gbl...
Hi Ian,

Based on my research and experience, There are two ways to instruct browser not to use the copy in cache.

1. Add a meta data inside the <head> section. Please check the following
article for the details.

Prevent the browser from Caching a page
http://www.pacificnet.net/~johnr/meta.html
"...
This page is an explanation of using the Meta tag to prevent caching, by
browser or proxy, of an individual page wherein the page in question has
data that may be of a sensitive nature as in a "form page for submittal"
and the creator of the page wants to make sure that the page does not get
submitted twice.
.."

2. From server side, we can render the meta data via the Response object.
For example,

Response.Expires = -1

Please check the HttpResponse class for the detailed info

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #5
Hi Kevin,

Thank you for your suggestion.

Please feel free to visit the following URL for sending feedback to
Microsoft Products.

http://register.microsoft.com/mswish...=EN-US&gssnb=1
"By offering suggestions through this page, you give Microsoft full
permission to use them freely. We can't guarantee we will use your
suggestions, but we will review them for use in future products..."

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #6

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

Similar topics

14
by: Ludwig77 | last post by:
I read that there are some tags that can be entered in a web page's meta tags in order to prevent web bot searching and indexing of the web page for search engines. What is the tagging that I...
10
by: Behzad | last post by:
Hi all I'am ASP programmer and I have built a site that users can upload and download files.All things store in a DB and everytime someone enters a page,the application requery the Db and shows...
3
by: Rob | last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish...
2
by: gu4y | last post by:
Hello All, Is there anyway to globally prevent client browser caching in ASP.NET? Otherwise, I will have to put: Response.Cache.SetCacheability(HttpCacheability.NoCache); in every page's...
2
by: COHENMARVIN | last post by:
I'm writing a database application in asp.net, and I'm worried that the users will sometimes click the BACK button in their browser, thus making some pages re-execute, and possibly messing up the...
1
by: Ronald S. Cook | last post by:
I have an ASPX page wherein I receive an ID of a file to play. http://localhost/fwi/mediaplayer.aspx?id=3 When I go to a browser and type in the above, it works fine. But when I change the 3...
9
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
I'm working on a litigation web app where users will review images of case documents. One of the requirements is that we either prevent the images from being cached on the clients machine (in temp...
1
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, After the user is signed out and taken to the login page, they can still use the back & history features in the browser to access pages. Every page (except login) has a check at the...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: 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...

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.