Alachisoft NCache 4.1 - Online Documentation

Step 2: Edit Web.Config or Machine.Config

 
NOTE: This feature is not available in NCache Express and Professional edition.
 
After you have configured the cache and have named it "myQSPartitionedCache", you now need to configure your ASP.NET application to use the Output Cache Module that is provided with NCache installation. To do so, you must edit web.config file.
Please follow these steps for enabling NCache Output Caching Module to transparently save and retrieve rendered pages.
 
  1. Register NOutputCache as httpmodule inside <system.web> in web.config file.
     
    <httpModules>
    <add name = "Alachisoft.NCache.Web.NOutputCache" type = "Alachisoft.NCache.Web.NOutputCache.NOutputCache,
    Alachisoft.NCache.OutputCache, Version=x.x.x.x, Culture=neutral, PublicKeyToken=cff5926ed6a53769"/>
    </httpModules>
     
    Note: Replace version “x.x.x.x” with the actual NCache version that you have.
     
  2. Register 'ncache' configuration section in the <configSections> of the web.config as follows:
     
    <configSections>
    <section name = "ncache" type = "Alachisoft.NCache.Web.NOutputCache.NCacheSection, Alachisoft.NCache.OutputCache, Version=x.x.x.x, Culture=neutral, PublicKeyToken=cff5926ed6a53769"/>
    </configSections>
     
  3. Then add actual <ncache> section in <configuration> section of web.config holding information of pages to be cached.
     
    <ncache>
    <outputCacheSettings cacheName = "myQSPartitionedCache" clientCacheName = "" exceptionsEnabled = "true" enableLogs = "false" enableClientCacheSync = "false">
    <outputCachePages>
    <add name = "/NOutputCacheSample/main.aspx" enabled = "true" requestType = "post" duration = "20" varyByParam = "cbxCustomerName" varyByHeader = "Connection" varyByCustom = "browser"/>
    </outputCachePages>
    </outputCacheSettings>
    </ncache>
     
    For detailed description of different key-value pairs specified above, please see Using Output Cache.
 
 
See Also
 
Copyright © 2005-2012 Alachisoft. All rights reserved.