programatically clearing the outputcache

D

David Lozzi

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
 
M

Michael Nemtsev [MVP]

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top