惊喜:超级简单的缓存文件,大幅提升网站速度!
方法:将下面的caching节点加到system.webServer节点下,当然可以手动在IIS7管理器添加.
<caching>
<profiles>
<add extension=".css" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".js" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".html" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".jpeg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".bmp" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".png" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".jpg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".gif" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
</profiles>
</caching>
<%@ OutputCache Duration="86400" Shared="true" VaryByParam="none" %>