Mugshot

Hey I'm Lee. My blog was put up to house useful nuggets I could refer back to, document my learning curves on new technologies and house tutorials I write for Umbraco and other .NET stuff.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar or terminology, so read at your own risk!

Blogs I Read

Sites I Like

Fixing IIS Caching My ISAPI URL Rewriting Text File (And all other files as well!)

Recently I had a major problem on my Win2003 server running IIS6, I am using ISAPI rewrite version 3 and use a text file that maps the URL's to the ID's.  For some weird reason, IIS was caching the text file even though when I downloaded the URL list it was definitely the new updated version - It would work fine if I restarted IIS, but that's a real pain in the arse to have to do that every time a new product / page was added or updated!  [more]

After a bit of messing around and an hour or so of searching I came across a great article about adding a register DWORD key that stopped IIS caching image files (Sorry I can't find the original article to link to)

Basically add the following DWORD value UriEnableCache and set it to 0

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters

Worked A TREAT!  Fixed the URL text file caching problem straight away after a quick reboot - Here's a list of all the different values you can add into

Registry key Default value Valid value range Registry key function WARNING code
AllowRestrictedChars 0 Boolean If nonzero, Http.sys accepts hex-escaped chars in request URLs that decode to U+0000 – U+001F and U+007F – U+009F ranges. 0
EnableAggressiveMemoryUsage 0 0,1 Preallocate non-paged pool memory. By default, the HTTP service stops accepting connections when less than 20 megabytes (MB) of non-paged pool memory is available. After you add this value to the registry, the HTTP service stops accepting connections when less than 8 MB of non-paged pool memory is available. Setting this registry value may reduce the number of "Connections_refused" and 503 errors in the Httperr.log file. 0
EnableNonUTF8 1 Boolean If zero, Http.sys accepts only UTF-8-encoded URLs. If non-zero, Http.sys also accepts ANSI- or DBCS-encoded URLs in requests. 0
FavorUTF8 1 Boolean If non-zero, Http.sys always tries to decode a URL as UTF-8 first; if that conversion fails and EnableNonUTF8 is non-zero, Http.sys then tries to decode it as ANSI or DBCS. If zero (and EnableNonUTF8 is non-zero), Http.sys tries to decode it as ANSI or DBCS; if that is not successful, it tries a UTF-8 conversion. 0
MaxBytesPerSend 65536 1-0xFFFFF (Bytes) Overrides the TCP window size that is used by Http.sys. A higher value may enable higher download speeds in network environments that have high bandwidth and high latency. 0
MaxConnections MAX_ULONG 1024(1k) – 2031616 (2MB) connections Overrides the MaxConnections calculation in the driver. This is primarily a function of memory. 1
MaxEndpoints 0 0 - 1024 The maximum number of current end point objects that are permitted. The default value of zero implies that the maximum is computed from available memory 1
MaxFieldLength 16384 64 - 65534 (64k - 2) bytes Sets an upper limit for each header. See MaxRequestBytes. This limit translates to approximately 32k characters for a URL. 1
MaxRequestBytes 16384 256 - 16777216 (16MB) bytes Determines the upper limit for the total size of the Request line and the headers.
Its default setting is 16KB. If this value is lower than MaxFieldLength, the MaxFieldLength value is adjusted.
1
PercentUAllowed 1 Boolean If non-zero, Http.sys accepts the %uNNNN notation in request URLs. 0
UrlSegmentMaxCount 255 0 - 16,383 segments Maximum number of URL path segments. If zero, the count bounded by the maximum value of a ULONG. 1
UriEnableCache 1 Boolean If non-zero, the Http.sys response and fragment cache is enabled. 0
UriMaxUriBytes 262144 (bytes) 4096(4k) – 16777216(16MB) bytes Any response that is greater than this value is not cached in the kernel response cache. 1
3
UriScavengerPeriod 120 (seconds) 10 - 0xFFFFFFFF seconds Determines the frequency of the cache scavenger. Any response or fragment that has not been accessed in the number of seconds equal to UriScavengerPeriod is flushed. 1
2
UrlSegmentMaxLength 260 0 - 32,766 chars Maximum number of characters in a URL path segment (the area between the slashes in the URL). If zero, it is the length that is bounded by the maximum value of a ULONG. 1
Back to top