DC517 Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
I am calling a web page using window.open("a.aspx","_self"). The page a.aspx is displayed but with old data i.e. an old instance of page is displayed. Is there a way by which I can get a fresh page every time I request for that page.
DC517 Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
I am calling a web page using window.open("a.aspx","_self"). The page a.aspx is displayed but with old data i.e. an old instance of page is displayed. Is there a way by which I can get a fresh page every time I request for that page.
abrahamsibu,
Since you are calling the page through window.open() but not doing a postback to the same original page that transfers you to the other page, the browser identifies the link as the one you already visited, searches your cache if the version of that page
already existings or not. If yes, it simply displays the page. There are meta tags that you can specify inside the head tag that may inform the broswser not to use the cached version but may a fresh request.
Use the following tags inside head tag of your page.
Both the above tags should be included if you are not sure if server is HTTP/1.1 compliant. Also Include:-
<META HTTP-EQUIV="EXPIRES"
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT"> tells the server which cache the page to expire the page in given time interval. An invalid interval like "0" or "-1" expires it immediately and causes a fetch of latest version of file, each time request is made.
abrahamsibu
Member
177 Points
31 Posts
Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 10:00 AM|LINK
How to disabe caching in Web.Config for the entire Asp .Net Application?
d4dennis@ins...
Star
9229 Points
1314 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 11:22 AM|LINK
Hi there,
Have a look at this article, might be interest you.
http://msdn.microsoft.com/en-us/library/ms178606(VS.80).aspx
Hope it helps!
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 11:32 AM|LINK
As far as i know, you can't disable the Cache for the entire application , if you don't want it , don't use it !
but you can diable outputcaching and session state for the etire application by removing its modules , this can be done from web.config
you can read more about performance optimization in this article,
abrahamsibu
Member
177 Points
31 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 11:39 AM|LINK
These tags are not there in my config files.
My actual problem is,
I am calling a web page using window.open("a.aspx","_self"). The page a.aspx is displayed but with old data i.e. an old instance of page is displayed. Is there a way by which I can get a fresh page every time I request for that page.
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 11:45 AM|LINK
Sure,
add this to your page load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
d4dennis@ins...
Star
9229 Points
1314 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 11:46 AM|LINK
Hi There,
You can add following code to a.aspx to instantly clear the cache of the page.
<
head runat="server"> <title>WebForm</title> <link rel="shortcut icon" href="favicon.ico" type="image/ico" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /></
head>Hope it helps!
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
venkyzeal
Member
154 Points
32 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 12:42 PM|LINK
abrahamsibu,
Since you are calling the page through window.open() but not doing a postback to the same original page that transfers you to the other page, the browser identifies the link as the one you already visited, searches your cache if the version of that page already existings or not. If yes, it simply displays the page. There are meta tags that you can specify inside the head tag that may inform the broswser not to use the cached version but may a fresh request.
Use the following tags inside head tag of your page.
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
Both the above tags should be included if you are not sure if server is HTTP/1.1 compliant. Also Include:-
<META HTTP-EQUIV="EXPIRES"
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT"> tells the server which cache the page to expire the page in given time interval. An invalid interval like "0" or "-1" expires it immediately and causes a fetch of latest version of file, each time request is made.
you can get complete info at this link :- http://www.i18nguy.com/markup/metatags.html
Kindly mark it as answer if this solves your concerns.
Syntel
mreynol5
Member
83 Points
226 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
May 30, 2008 05:03 PM|LINK
Yes
CrystalVoice, LLC
josh.mouch
Member
10 Points
5 Posts
Re: Disabling caching in Web.Config for the entire Asp .Net Application
Jun 29, 2012 07:17 PM|LINK
This didn't answer the question. The poster was looking for a way to disable caching for all dynamic pages using the web.config.