How IIS Uses the File System Cache

The IIS services rely on the operating system to store and retrieve frequently used Web pages and other files from the file system cache. The file system cache is particularly useful for servers of static Web pages. Web pages tend to be used in repeated, predictable patterns. Files read repeatedly are more likely to be found in the cache.

Also, Internet Information Server always reads sequentially. Sequential reading takes advantage of a Windows NT Cache Manager feature called a read ahead. A read ahead occurs when the Cache Manager's predictive algorithms detect sequential reading and begin to read larger blocks of data in each read operation. Read aheads can provide a significant performance boost to the process.

The IIS services use the file system cache and the IIS Object Cache. Sometimes, the caches are used together. When a thread of an IIS service needs to open a file, the thread requests a file handle from the operating system. When the thread receives the handle, the thread uses the handle to open the file. Then, if space permits, the thread stores the handle in the IIS Object Cache and the system stores the file data in the file system cache. Later, if that thread, or any other thread, needs the file, the file handle can be retrieved from the IIS Object Cache and the file contents can be retrieved from the file system cache.

The performance of IIS servers can benefit substantially from the file system cache, but only when the cache is large enough to hold all of the files the server needs. You can measure the size and effectiveness of the file system cache by using Performance Monitor.