Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<%@ OutputCache Duration="60" Location="ServerandClient" VaryByParam="*" %>

public void clearcache()
{
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddSeconds(-60));

}
I used above code to implement caching at local system.Its work fine.
But when site host at server with same code,I can get data fast but when i changed the data like insert or delete its not reflect with UI.(Need to refresh page to see changes)
What should i do?????????
Posted
Comments
Member 12003400 22-Sep-15 10:05am    
Are you updating cache while inserting and updating records?
Please specify your question clearly. This is not that clear.
Member 11744128 22-Sep-15 10:15am    
How to updating cache while inserting and updating records??
Member 11744128 24-Sep-15 2:01am    
How to Clear client cache with caching In asp.net??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900