eric_s
-
1/28/2007 4:33:10 PM
Re: Flushing cache when page is updated through CMS Desk
This is a bit of a hack solution, but basically, I added a page in the tools area that has a button that clears the cache. The button just does as follows, manually removing everything from the cache. Obviously not ideal, but it's helpful when I'm authoring pages and want to see results immediately.
protected void btnClearCache_Click(object sender, EventArgs e) { try { //Clear all the items from the cache //It's possible that this could cause some errors IDictionaryEnumerator CacheEnum = Cache.GetEnumerator(); while (CacheEnum.MoveNext()) { string key = CacheEnum.Key.ToString(); Cache.Remove(key); } this.lblMessage.Text = "Cache was successfully cleared."; } catch (Exception ex) { this.lblMessage.Text = ex.Message;
} }
|