Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

programatically clearing the outputcache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 03 Dec 2007 22:48 GMT
Howdy,

How do I forcibly clear out the cache for entire web application? I want to
give my customer the option to clear the cache after any major data updates
they may do.

Thanks!

David Lozzi
Michael Nemtsev [MVP] - 04 Dec 2007 07:48 GMT
Hello David,

Use the Response class to clear the cache

Response.Expires = 0
Response.CacheControl = "no-cache"
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache)
Response.Cache.SetNoStore()
Response.Buffer = True
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
Response.AppendHeader("Pragma", "no-cache")
Response.AppendHeader("", "")

if it doesnt help then u need to restart IIS - there is no API for this.
u need to kill the process programmatically

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

DL> Howdy,
DL>
DL> How do I forcibly clear out the cache for entire web application? I
DL> want to give my customer the option to clear the cache after any
DL> major data updates they may do.
DL>
DL> Thanks!
DL>
DL> David Lozzi
DL>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.