I have this lines in all my master page code-behind Page_Load method. Now, one interesting observation I have found.
When a session expires, and I tried to open some page in my application, it redirected me to logout.aspx as it should. After that I clicked on [Back] button of browser for few times. In this case, as the session has expired, I expected logout.aspx rather
than the actual pages as they are not cached. But it showed actual page with all the contents.
Any ideas, how can I show logout.aspx page instead of all those pages?
Thanks! Really helpful. But not working for Safari very weill. Safari will popup window to ask if send back to server, after clicking 'send', you will get the cached page again. Anyone knows how to make it work?
i have been looking for the solutions from pretty long time and after reading this thread i'm still having no luck
i followed everything you guys have talked here but nothing works
is anybody can help please?
i have a windows authentication mode using asp.net 2 C#
if a user clicks on back button i want the user to stay on the same page or expire the back button or disable the back button but something that when user clicks back button i dont want the user to be able to go to previous page
also i have open a new thread if you please wanna look at it?
Can u plz help me in the scenerio which is some what the same .. .as its addressing here
sccenario:
we have a proxy server which is assigned by a fixed ip and user access it through proxy ...
we have deployed our application over there, which is built in ASP.NET 2.0 and we have also used seperate javascript files (*.js) and proxy server as usual caches the page and javascript files
when ever we have some changes we deploy our application again at the proxy server
but when we run the application it uses the same cached javascript files and dont use the new one which we have deployed
can you help me in this regard that what should i do ???
sdgough
Member
94 Points
27 Posts
Re: How to prevent browser and proxy caching of web pages
Dec 21, 2006 04:10 PM|LINK
This works fine in IE & Firefox for me...
I have it in my master page code-behind.
-Sean
ujjaval
Member
251 Points
73 Posts
Re: How to prevent browser and proxy caching of web pages
Jan 08, 2007 04:44 AM|LINK
just checking.. if I put this in global.asax.cs file, it will work for whole web application.. right?
ujjaval
Member
251 Points
73 Posts
Re: How to prevent browser and proxy caching of web pages
Jan 08, 2007 10:40 PM|LINK
I have this lines in all my master page code-behind Page_Load method. Now, one interesting observation I have found.
When a session expires, and I tried to open some page in my application, it redirected me to logout.aspx as it should. After that I clicked on [Back] button of browser for few times. In this case, as the session has expired, I expected logout.aspx rather than the actual pages as they are not cached. But it showed actual page with all the contents.
Any ideas, how can I show logout.aspx page instead of all those pages?
Thanks,
Ujjaval
AndreiR23
Member
14 Points
9 Posts
Re: How to prevent browser and proxy caching of web pages
Jan 09, 2007 09:02 PM|LINK
Thanks! It works great on IE 6.x and FireFlox but it won't work for Opera.. :(
Anyone knows a trick for the Opera browser (well.. at least if you heard of Opera... )
Netee
Member
8 Points
6 Posts
Re: How to prevent browser and proxy caching of web pages
Feb 07, 2007 11:55 PM|LINK
Thanks! Really helpful. But not working for Safari very weill. Safari will popup window to ask if send back to server, after clicking 'send', you will get the cached page again. Anyone knows how to make it work?
Sean
cozyshri23
Member
2 Points
3 Posts
Re: How to prevent browser and proxy caching of web pages
Feb 27, 2007 06:59 AM|LINK
The above lines dont seem to work for fireFox 2.0 .
I need to clear the cache coz when I do a browser back, there is data on my textbox.
buntybunty
Member
4 Points
5 Posts
Re: How to prevent browser and proxy caching of web pages
Feb 27, 2007 08:34 AM|LINK
buntybunty
Member
4 Points
5 Posts
Re: How to prevent browser and proxy caching of web pages
Feb 27, 2007 08:49 AM|LINK
Response.ClearHeaders(); Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1 Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1 Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1 Response.AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1 Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1nisarkhan
Contributor
2402 Points
1472 Posts
Re: How to prevent browser and proxy caching of web pages
Jun 15, 2007 03:56 PM|LINK
i have been looking for the solutions from pretty long time and after reading this thread i'm still having no luck
i followed everything you guys have talked here but nothing works
is anybody can help please?
i have a windows authentication mode using asp.net 2 C#
if a user clicks on back button i want the user to stay on the same page or expire the back button or disable the back button but something that when user clicks back button i dont want the user to be able to go to previous page
also i have open a new thread if you please wanna look at it?
http://forums.asp.net/t/1120854.aspx
thanks
--------------------------
Don't forget to click "Mark as Answer" on the post(s) that helped you.
anilakhwaja
Member
4 Points
2 Posts
Re: How to prevent browser and proxy caching of web pages
Jul 13, 2007 11:41 AM|LINK
Can u plz help me in the scenerio which is some what the same .. .as its addressing here
sccenario:
we have a proxy server which is assigned by a fixed ip and user access it through proxy ...
we have deployed our application over there, which is built in ASP.NET 2.0 and we have also used seperate javascript files (*.js) and proxy server as usual caches the page and javascript files
when ever we have some changes we deploy our application again at the proxy server
but when we run the application it uses the same cached javascript files and dont use the new one which we have deployed
can you help me in this regard that what should i do ???