Reputation: 819
I have an MVC 4 (Razor) website and I've enabled Azure Cache (Preview) (Co-Located) for both the session and the outputCache providers. Since I enabled it, each web request causes a massive CPU spike and results in 3-5 second page response times while debugging.
I have narrowed the problem down to the outputCache provider. If I disable it in the web.config, the site runs great. No CPU spikes. I am not using page output caching yet... so no reads/writes should be occurring. The session provider runs fine via Azure Cache (Preview). Below is my outputCache config. If I disable it, the site runs without CPU spikes. Any thoughts?
<caching>
<outputCache defaultProvider="DistributedCache">
<providers>
<add name="DistributedCache" type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" />
</providers>
</outputCache>
</caching>
Upvotes: 4
Views: 1491
Reputation: 819
It appears the issue is due to the Web Optimization Framework. It does not have server caching enabled for non-default cache providers (e.g. Azure Cache Preview). So each time a request is made, the web server has to rebundle which is causing the CPU spikes. A future version of Microsoft.AspNet.Web.Optimization should enable server caching again.
Here's the issue on on CodePlex.
Upvotes: 4