I wanted to know if the web.config
caching section is the same cache used by the MVC HttpRuntime.Cache
.
If they are, is there any way to use them separately ? I want to have a 10 minutes cache for my pages ( routes ) and a 1 hour cache for my static content: html, css, js, etc.
This is my .NET cache:
HttpRuntime.Cache.Insert(
key : cacheKey,
value : clone,
dependencies : null,
absoluteExpiration: DateTime.UtcNow.AddMinutes( 10 ),
slidingExpiration : Cache.NoSlidingExpiration,
priority : CacheItemPriority.NotRemovable,
onRemoveCallback : null
);
This is how i use the web.config cache:
[OutputCache( CacheProfile = "Cache1H" )]
This is my web.config cache:
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="Cache1H" duration="3600" varyByParam="none" noStore="true" location="Client" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
</system.web>
EDIT
How could i reset or expire the HttpRuntime cache from another application ? Let's say i have a website and i want do reset it at my admin so the website would update the cache and get the new information.