Configuring ASP Template Caching

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

ASP processes the files that contain ASP scripts, stores these processed files in a cache, and then serves the cached files to clients. Caching ASP script files enhances performance because cached ASP scripts are not compiled each time they are called. The corresponding metabase property is AspScriptFileCacheSize Metabase Property. AspScriptFileCacheSize Metabase Property specifies the number of precompiled script files to cache.

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

To change the settings for caching ASP script files

  1. In IIS Manager, double-click the local computer, double-click the Web Sites folder, and then click Properties.

  2. Click the appropriate tab: Home Directory, Virtual Directory, or Directory.

  3. In the Application Settings area, click Configuration, and then click the Cache Options tab.

    Note

    If the Configuration button is not active, the directory or starting point does not contain an isolated application. You can create a new application by clicking Create.

  4. In the ASP File Cache section, configure the ASP cache setting by doing one of the following:

    • To cache all requested .asp files, select the Cache all ASP files in memory check box. The maximum amount of files that can be cached is 2,000,000,000.

    • To set the maximum number of files cached in memory, select the Cache limited ASP files in memory check box, and then click the up or down arrow to set the maximum number of files. Files in excess of this number are persisted to the disk cache if you select the Cache remaining ASP files on disk check box. Or you can limit the total number of ASP files cached by selecting the Cache limited ASP files on disk check box, and then clicking the up or down arrow to set the maximum number of files.

    • To turn off the cache, select the Do not cache ASP files check box.

  5. Click OK.

The ASP disk cache begins caching files into a directory when the ASP memory cache is full. Furthermore, a file has to be requested at least twice before it becomes a candidate for the ASP disk cache. The corresponding metabase property, AspMaxDiskTemplateCacheFiles Metabase Property, specifies the maximum number of compiled ASP templates that can be stored. AspDiskTemplateCacheDirectory Metabase Property contains the name of the directory that ASP uses to store compiled ASP templates to disk after overflow of the in-memory cache.

Important

In order for disk caching to work, ASP needs a properly configured disk cache directory in which to store the compiled ASP files. This means that the Administrators and IIS_WPG groups have full control on the disk cache directory and that the disk cache directory is a local directory on the Web server.

To create a disk cache directory

  1. In IIS Manager, double-click the local computer, double-click the Web Sites folder, right-click the Web site that you want, and then click Properties.

  2. Click the appropriate tab: Home Directory, Virtual Directory, or Directory.

  3. In the Application Settings area, click Configuration.

  4. Click the Cache Options tab, and in the Disk cache directory box browse to the directory used for disk caching.

  5. Click OK.

Note

ASP requests might fail unless the IIS_WPG group has Read/Write and Delete permission for the ASP template cache directory. For more information about ASP template caching and the ASP disk cache, see ASP Template Caching.