O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring the cache

Caching frequently used, rarely updated data can greatly improve the performance of websites and other high traffic applications. In this recipe, we'll configure NHibernate's cache, just as we would for a typical public facing website.

Getting ready

  1. Complete the Configuring NHibernate with App.config recipe from Chapter 1.
  2. Download the NHibernate Caches binary files from SourceForge at http://sourceforge.net/projects/nhcontrib/files/.
  3. Extract NHibernate.Caches.SysCache.dll to your solution's Lib folder.

How to do it...

  1. Add a reference to NHibernate.Caches.SysCache.dll.
  2. Open the App.config file.
  3. In the configSections element, declare a section for the cache configuration:
    <section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required