大网数据广告活动
Web服务器与PHP

Instances where HTTP.sys doesn't cache

· 52CE 我爱测

This article describes the instances that the HTTP.sys driver doesn't cache content.

This article introduces Instances where the HTTP.sys driver doesn't cache content.

Original product version:   Internet Information Services
Original KB number:   817445

Situations where HTTP.sys doesn't cache

The HTTP.sys response cache caches any request with the appropriate flag in the request header. This cache is disabled on a per-request basis. However, if one or more of the following conditions are true, HTTP.sys doesn't cache the request response:

  • The request isn't an anonymous request.

  • The request requires authentication. (For example, the request contains an Authorization: header.)

  • The website is configured to use a footer.

  • Dynamic compression is enabled and is used for the response.

    [!NOTE] Static compression can be used with HTTP.sys caching.

  • The static file is a Universal Naming Convention (UNC) file and the DoDirMonitoringForUnc registry key isn't enabled.

    [!NOTE] You can use the DoDirMonitoringForUnc registry property (a DWORD value) to switch the static file cache back to a change notification cache. This is set as follows: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Inetinfo\Parameters
    The default value is 0, or not enabled. It can be set to 1 to enable caching of static content based on change notification.

  • The request contains a query string.

  • The cache is disabled. (That is, the MD_VR_NO_CACHE metabase property equals 1.)

    [!NOTE] More information about the MD_VR_NO_CACHE metabase property is available in the product documentation. To view this documentation, see DisableStaticFileCache.

  • The request has an entity body.

  • Certificate mapping is enabled for the URL.

  • Custom logging is enabled for the website.

  • The request HTTP version isn't 1.1 or 1.0.

  • The request contains a Translate: f header.

  • An Expect: header that doesn't contain exactly 100 continue is present.

  • The request contains either an If-Range: header or a Range: header.

    [!NOTE] HTTP.sys processes only whole responses. HTTP.sys does not try to send ranged responses.

  • The response spans multiple SendResponse and SendResponseEntityBody calls.

    [!NOTE] A cacheable response must come down in a single, vectored SendResponse call.

  • The total response size is larger than the per-response maximum size. The maximum is controlled by the UriMaxUriBytes registry key, and the default value is 256 KB.

  • The response header size is larger than the per-response maximum header size. The default value is 1,024 bytes.

  • The cache is already full. The default size is proportional to the physical memory in the computer.

  • The response is zero length.

  • An Internet Server Application Program Interface (ISAPI) filter that isn't cache-aware is installed.

    [!NOTE] By default, ISAPI filters are not cache-aware. You must set the FilterEnableCache metabase property for the filter to make it cache-aware. All filters in a default installation of IIS are cache-aware. This includes FrontPage and ASP.NET.
    For more information about the FilterEnableCache metabase property, view What's new in Windows 10 deployment.

  • A static file is accessed as a default document. (For example, Default.htm exists in the root directory.) Accessing the specific file by name (http://contoso.com/default.htm/) causes HTTP.sys to cache the file. Accessing the website by requesting the root folder (http://contoso.com/) results in a non-cached response.

    [!NOTE] If the first page that's listed in the Default Document list is inaccessible, IIS tries to serve the second page in the Default Document list. In this situation, that static page will not be served from the cache.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 12/17/2024
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。