IIS will not cache a large (76 MB) file

I cannot force IIS on Windows 2012 R2 to cache a large .exe file. That is, when I constantly request a file, I see that the file is constantly being read in the Resource Monitor and it starts

netsh http show cachestate

does not show the cached file.

I think I configured the system to cache .exe files for a folder in the kernel and not have a maximum file size. The total cache size is 0, and I understand that the system will use up to half of all memory. The server has 6 GB of RAM, many of which are free.

That is, in the output cache settings for the web server root:

  • The maximum size of the cached response (in bytes) = 0 (also reflected in valueHost.config maxResponseSize)
  • The cache size limit (in MB) is not checked (also in the application Host.config maxCacheSize = 0)
  • Enable cache and enable kernel cache (both set to true in applicationHost.config

I serve the file from a virtual folder configured as an ASP.NET 4.0 application. 4.6.2. The virtual folder points to a UNC share that is on the same system. (I know that I can point to the local file system, I mimic the hosting files that are on another system.)

Web.config file:

<?xml version="1.0" encoding="utf-8"?>
  <configuration>
  <system.webServer>
    <handlers>
      <clear />
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
    </handlers>
    <caching>
      <profiles>
        <add extension=".txt" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
        <add extension=".exe" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
      </profiles>
    </caching>
  </system.webServer>
</configuration>

It will cache small .txt and .exe files (about 20 bytes each).

What am I missing that IIS is not caching a large file?

+4
source share
1 answer

(UriMaxUriBytes), , 16 . , http.sys . , KB ---HTTP-SYS----

- DWORD :

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\

  • UriMaxUriBytes -UriMaxUriBytes 262144 () 4096 (4k) - 16777216 (16 ) , , . 1 3

  • UriScavengerPeriod - . , , UriScavengerPeriod, .

UriMaxCacheMegabyteCount ( , ), http.sys,

  • HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters\UriMaxUriBytes 16777216
  • UNC, 16
  • mime

msdn

, !

+2

Source: https://habr.com/ru/post/1682336/


All Articles