Did someone ask..DisableMemoryCache & IIS

I delivered a presentation during the IIS Webcast Series regarding Server Performance Advisor 2.0 & IIS 6.0.  There was one simple scenario whereby I demonstrated how Server Performance Advisor 2.0 would locate and indicate to a IT Professional and\or Developers when caching had been disabled.

During this presentation, I might have used this registry switch to cause this behavior to occur though it is not a scenario that I suggest anyone use in production environments.  The lack of caching tremendously reduces the performance of any web applications and hereby should be avoided if at all possible.

Is it true that tonight being a US Friday night, I battle jet-lag from a 12 to 13 hours of flying yesterday leads me to simply write a quick and dirty blog – hence, let me explain what this registry key does and more importantly how to avoid the use of it.  For IIS 6.0 customers, many might be trivialized as to how this effects the new kernel-caching features offered by HTTP.sys — it disables it.  If usermode caching such as IIS caching and\or ASP.NET caching then by default all kernel capabilities are disabled.

Where to locate DisableMemoryCache?

    1).  Open Regedit

    2).  Navigate to HKey_Local_Machine\System\CurrentControlSet\Services\Parameters\W3SVC

    3).  If listed, a DWORD value of 1 will be listed in the right-hand pane

If listed, you will be required to restart the IIS services.  To do so, use either IIS Reset and\or net stop w3svc & net start w3svc.

As mentioned, this completely disables caching for your web applications.  The suggestion, if any, is to not disable caching but instead look at opportunities to “tune” caching within your web application.  IIS offers a few options in the form of the registry and\or metabase.  For example, review and understand what ObjectCacheTTL can do for you as a alternative to disabling caching altogether.

This offers you the opportunity to maintain the benefits of caching while just using your smarts to control the amount of time caching is offered — down to the 1 second. 

For more IIS Tuning & Performance information, please review the following useful documents:

Windows Server 2003 & IIS 6.0:

Windows 2000:

I hope this offer a 100 level clarity to this registry key… use with caution!  Enjoy!

~Chris

No Comments