Content Management Server uses caching to increase the speed of page processing and thus to improve the performance of the Web site. Three types of caching can be used with CMS: disk cache, in-memory object cache, and ASP.NET output cache. Disk cache and in-memory object cache are configured using the SCA Cache tab (Figure 18-8). Figure 18-8. Cache settings
NOTE: ASP.NET output caching is configured directly in the ASP.NET-based page templates; it cannot be configured in the SCA. Disk CacheThe disk cache is a file-based cache for page resources. The location of the cache is configured during the installation of CMS. The default location is <installation drive>\Program Files\Microsoft Content Management Server\Server. After the installation, the cache location can be changed using the SCA. Two directories are created under the specified cache location:
These two directories are added to the CMS Web site as the virtual IIS directories under the /NR virtual directory: /NR/rdonlyres and /NR/exeres, respectively. When you change the physical cache location, these virtual directories are reconfigured automatically to point to the newly created directories for the dynamic and the read-only cache. The cache directories' locations are stored in the registry. The registry key HKEY_LOCAL_MACHINE\SOFTWARE\NCompass\Resolution Content Server\Configuration\0\Local\Cache contains the values PhysicalExecPrefix and PhysicalReadPrefix, which point to the physical disk location of the dynamic cache and the read-only cache, respectively. The /NR/exeres directory is used for dynamic caching only in ASP-based sites. In ASP.NET-based sites, dynamically generated pages and user controls are cached in the ASP.NET output cache. However, the ID-based page and channel URLs in both ASP and ASP.NET sites look as if the resulting pages were served from /NR/exeres for example, http://www.botsconsulting.com/NR/exeres/30895FCA-6899-46FD-94E5-241CB1BC6888.htm. In ASP.NET sites, this is just a convention for how the ID-based URLs are formed; the pages are not cached in the disk-based dynamic cache. To set up the cache location, click Configure on the Cache tab; in the Cache Configuration window (Figure 18-9), click Browse; in the Disk Cache Location Browser (Figure 18-10), navigate to a folder you want to become the cache location (the currently selected folder will be highlighted in red), and then OK to confirm in the Cache Configuration window. Figure 18-9. Cache Configuration windowFigure 18-10. Disk Cache Location BrowserIt is a good practice to put the CMS cache and the IIS log files on different drives, to prevent the log files from accumulating and causing problems with the CMS caching. The minimum cache size is 50MB. The maximum cache size is the currently available free space on the cache location drive. The default is 50% of the maximum, up to 2GB. To set up the maximum cache size, in the Cache Configuration window (Figure 18-9), click the top Set Global button to specify the global maximum cache value for the cluster (Figure 18-11), or type the value for the local maximum cache in the bottom Current Override Value box. Figure 18-11. Global Maximum Disk Cache SizeNode CacheNode cache settings allow us to configure the in-memory object cache. When the CMS server accesses objects stored in the Content Repository, these objects are referred to as nodes. Once the database has been queried, the server caches the resulting objects as nodes in memory to avoid additional database access. Using the SCA, we can:
To set up the maximum number of nodes in memory cache, in the Cache Configuration window (Figure 18-9), click the bottom Set Global button to specify the global maximum number of nodes in memory cache for the cluster (Figure 18-12), or type the value for the local maximum number of nodes in memory cache in the bottom Current Override Value box. Figure 18-12. Global Maximum Nodes in Memory CacheThe size of the node cache should be sufficient to store frequently accessed objects but not so large that it has to be stored in virtual memory.
NOTE: You can use the Task Manager to monitor physical memory usage. Clearing the in-memory node cache provides the ability to force synchronization with the database. If the server appears to be suffering from synchronization problems, click the Clear Memory Cache button on the SCA Cache tab (Figure 18-8). You may notice a minor decline in server performance during the memory clearing operation. |