mwrock/RequestReduce — Issue #106: Programmatic way to flush cache on startup
Author: mjwills
Created: 2012-01-09 04:50:54+00:00
State: open

I have some code like below in Application_Start:

If My.Settings.EnableRequestReduce Then
' Here I want to flush the cache
Else
RequestReduce.Api.Registry.AddFilter(New RequestReduce.Api.PageFilter(Function(x) True))
End If

The objective is twofold:

a) The If condition - to flush the cache on app startup (the app will be on a single web server, and this to make life easier for the sysadmins in that when they do a deploy they will *know* the cache will be flushed).
b) The Else condition - Disable RequestReduce altogether when developing. This is working fine.

I've had a look at the API, but can't see a way to do a) (flush the cache) without hitting a URL (which obviously must occur after app startup). Is there a (programmatic) way I am missing?