0

I have a cache rule in a directory by file extension and there are 2 dynamic pages in that directory.

    <configuration>
        <system.webServer>
            <caching>
                <profiles>
                    <add extension=".asp" 
                         policy="CacheForTimePeriod" 
                         kernelCachePolicy="DontCache" 
                         duration="03:00:00" 
                         location="Any" 
                         varyByQueryString="*" />
                </profiles>
            </caching>
        </system.webServer>
    </configuration>

There really isn't a significant difference between the two, they both run off querystrings, however, IIS doesnt want to cache one of them for some reason I can't figure out why. One of the pages it caches perfectly, but the other it doesn't. I was thinking it may have been due to the output filesize, since the page being cached is always under 256kb and the other is usually over, and 256kb is the default setting in MaxCachedFileSize. So I added the following registry as per ms suggestions:

HKLM\System\CurrentControlSet\Services\InetInfo\Parameters\MaxCachedFileSize

I set it to 10485760 bytes (10mb), since default is 256kb. Still not caching. As I said, the other file in the same dir caches fine, but the other one doesn't. Not sure what it could be, there is barely any memory being used on the server, so I don't think this can be a memory space not available issue.

Also, I've read that sending cookies in the page can cause IIS not to cache the page, but neither of the pages are sending cookies.

Control Freak
  • 12,965
  • 30
  • 94
  • 145

1 Answers1

0

Removing Response.Flush from the page did the trick for anyone else in the future.

Control Freak
  • 12,965
  • 30
  • 94
  • 145