Any possibility to avoid cache in asp.net
-
You mean apart from turning it off ? Most people ask this because they've written bad security code, and need to fix it. Is that your problem ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You mean server cache or client cache ?? :confused:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
You mean apart from turning it off ? Most people ask this because they've written bad security code, and need to fix it. Is that your problem ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
In my page While the landingpage was load, the videos are displayed. Then i move to another page name video.aspx and upload one new video.when i move to the landing page That currently inserted video is not reflected in the landing page. I think because of cache problem.Any solution?
-
You mean server cache or client cache ?? :confused:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
In my page While the landingpage was load, the videos are displayed. Then i move to another page name video.aspx and upload one new video.when i move to the landing page That currently inserted video is not reflected in the landing page. I think because of cache problem.Any solution?
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Remove Output Cache for One Page
HttpResponse.RemoveOutputCacheItem("/foldername/CacheForever.aspx");
Add Key Dependency to Page
Response.AddCacheItemDependency("clearcachekey");
Means we placed a dependance on smallkey. Now place this in global.aspx
protected void Application_Start(Object sender, EventArgs e)
{
HttpContext.Current.Cache.Insert("clearcachekey", DateTime.Now, null,
System.DateTime.MaxValue, System.TimeSpan.Zero,
System.Web.Caching.CacheItemPriority.NotRemovable,
null);
}or add this in pageload on which you want to remove cache :
HttpContext.Current.Cache.Insert("clearcachekey", DateTime.Now, null,
System.DateTime.MaxValue, System.TimeSpan.Zero,
System.Web.Caching.CacheItemPriority.NotRemovable,
null);:thumbsup:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
In my page While the landingpage was load, the videos are displayed. Then i move to another page name video.aspx and upload one new video.when i move to the landing page That currently inserted video is not reflected in the landing page. I think because of cache problem.Any solution?
anushh wrote:
That currently inserted video is not reflected in the landing page. I think because of cache problem.
Yes it is because of caching. Browsers cache content depending on the URL. So when video is uploaded, change the URL of the video so that browser will load the latest content. To do this, add a dummy time stamp to the video link. Something like
video.aspx?videoid=10×tamp=somerandomvalue
since the random value will be different each time, browser will be forced to load a latest version for each request. :)Navaneeth How to use google | Ask smart questions