I am using asp.net mvc output caching in my .net application but want to control when it gets fired. I have another custom http module that I need to fire prior to the output cache module firing. I made following change in web.config
<modules runAllManagedModulesForAllRequests="false">
<remove name="OutputCache" />
<add name="MyCustomModule" type="Namespace.MyCustomModule" preCondition="managedHandler" />
<add name="OutputCache2" type="System.Web.Caching.OutputCacheModule"/>
<remove name="PassportAuthentication" />
<remove name="Profile" />
<remove name="AnonymousIdentification" />
<remove name="FileAuthorization" />
<remove name="Session" />
<remove name="WindowsAuthentication" />
<remove name="UrlAuthorization" />
</modules>
Problem is its still not controlling the order the modules fire. Output cache module still fires before custom module. Any way to manage this?
I tried creating a custom implementation of the OutputCacheModule but as its a sealed class I was not able to.
Any help?