IIS 7 and Above
Kernel caching in IIS8.5/10
Last post Dec 06, 2017 09:04 AM by Yuk Ding
Dec 04, 2017 05:07 AM|Brij1|LINK
I know the benefits and limitations of Kernel Mode caching but recently I was trying it on Windows Server 2012 (IIS 8.5) and it appeared no perf improvement or may be not working.
I applied kernel cache for .aspx page but no improvement. I tried the command NETSH HTTP SHOW CACHESTATE then it resulted in no result which made me think that either the command is not working (I used it in windows server 2008) or caching is not working.
Dec 05, 2017 02:12 AM|Yuk Ding|LINK
I set the kernel cache for .aspx and try to access the aspx file. I find that if I access the .aspx file first of time. Then the netsh http show cachestate will not return any result. However, if I try to access the aspx file again, the netsh http show cachestate
will return this:
Status code: 200
HTTP verb: GET
Cache policy type: User invalidates
Request queue name: site2
Content type: text/html; charset=utf-8
Content encoding: (null)
Headers length: 182
Content length: 834
Hit count: 1
Force disconnect after serving: FALSE
And this is what did I set in web.config:
<add extension=".aspx" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
So maybe the result will not be returned while the first request will not trigger the output caching.
Dec 05, 2017 04:02 AM|Brij1|LINK
Thanks for your response. I exactly did the same for my application and sent load of requests but for me the command only returns "There were no cache entries corresponding to the provided URL", however I didn't provide any specific URL.
Which OS/IIS/ASP.NET version you are using
FYI - I am using a Azure VM (Windows Server 2012 R2 DataCenter), IIS 8.5.9600.16384 and ASP.NET WebForms 4.5.2
Thanks in advance
Dec 05, 2017 06:58 AM|Yuk Ding|LINK
I use windows 10 IIS 10 asp.net 4.0 CLR. Have you enabled the cache and kernel cache in IIS manager->site level->edit feature settings->enable cache/enable kernel cache. Then the kernel cache should be triggered once the second request access the http.sys.
And the cache entry only live 5 seconds. So you need to test it instantly. Of course the most convenient way is monitor Total URIs Cached in IIS process monitor :
Dec 06, 2017 02:06 AM|Brij1|LINK
Thanks a lot Yuk for your reply.
I am sure I am checking it instantly (<5sec) after issuing the requests. Also kernel settings are enabled as you suggested.
Also as you suggested I tried the perf counter and issues 100s of requests via fiddler but it does not served from cache
Please find counters screen shot here https://ibb.co/eONSeb
I although Total URIs cached is showing 22 but not sure from where it is coming from. Also only URI cache
misses is increasing, rest are just zero.
Not sure what specific I am missing. I tried on Win 10/IIS 10 with no luck
Thanks a lot again.
[Update] : I tried putting html file and enable catching for it (put only at edit feature at default website
and deployed app) seems workinng and getting all the counters and netsh command. But for aspx not working. Anonymous auth enabled. So not sure what could be the issue. This aspx page contains only html and part of defail asp.net webforms 4.5 project.
Dec 06, 2017 09:04 AM|Yuk Ding|LINK
Have you checked whether the IIS/binding has been installed correctly. Maybe there is something wrong with your binding led to the failure of the output caching.
In addition, have you tried the user node cache?
Maybe you could try: