Using ASP.NET Caching on top of NHibernate 2nd Level Caching
Should i consider using ASP.NET Caching to cache query result开发者_运维技巧s on top of NHibernate 2nd Level Caching to improve performances ?
I think it's enough ot NHibernate 2nd level cache. There are no need for additional overhead by using asp.net caching to cache the same query results. But if you need ultimate performance you can cache your rendered pages and controls using IIS Kernel cache (native output cache). And also I recommend you to profile your application using NHibernate Profiler. It'll show cache misses and a lot of useful information about your queries with some good recommendations.
Edit:
NHibernate.SysCache2 uses ASP.NET cache and it is a bit slower because it supports SQL dependency-based expiration, meaning that it is possible to configure certain cache regions to automatically expire when the relevant data in the database changes.
Also you can try to cache your ViewModels. But if you can cache them then you also can cache the generated views which is much better and faster. And this article may be helpful for you - http://haacked.com/archive/2009/05/12/donut-hole-caching.aspx
精彩评论