Setting the IIS Object Cache Time Period

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

The value of ObjectCacheTTL controls the static file cache by specifying the Time To Live (TTL), which sets the length of time that objects are held in cached memory. If an object in the memory cache has not been referenced for the defined period, that object is phased out of the cache.

Warning

Do not edit the registry unless you have no alternative. The registry editor bypasses standard safeguards, allowing settings that can damage your system, or even require you to reinstall Windows. If you must edit the registry, back it up first and see IIS 6.0 Registry Reference.

Use the following procedure to reset the time that an unused object remains in the object cache by adding the ObjectCacheTLL entry to the registry.

Important

You must be a member of the Administrators group on the local computer to edit the registry. 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 open a command window as an administrator. At a command prompt, type runas /profile /user:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type regedit.exe to open the registry editor.

To reset the period that unused objects remain in the cache

  1. From the Start menu, click Run, type regedit.exe, and then click OK.

  2. In the registry editor, navigate to the following subkey:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters

  3. Right-click the Parameters subkey, point to New, and then click DWORD Value.

  4. In the New Value box, type ObjectCacheTTL.

  5. Right-click ObjectCacheTTL, and then click Modify.

  6. Under Base, click Decimal.

  7. In the Value Data box, type the number of seconds that you want an unused object to remain in the cache, and then click OK.

    The default value is 30 (seconds). You can enter any value from zero, to disable caching, through 4,294,967,295 (unlimited), to disable the object-cache scavenger and allow cached objects to remain in the cache until the cached object changes.