IIS中User-mode caching引起的Cache-Control不为public问题的解决方法
2013-11-22 16:06
501 查看
web.config中对应的配置如下:
<configuration>
<system.webServer>
<caching>
<profiles>
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="00:00:30" />
</profiles>
</caching>
</system.webServer>
</configuration>
浏览器中看到的效果:
解决方法:
1、禁用User-mode caching,只用Kernel-mode caching。
2、在web.config中加上cacheControlCustom="public"
复制代码 代码如下:<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="300.00:00:00" />
</staticContent>
<caching>
<profiles>
<add extension=".css" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="30:00:30" />
<add extension=".js" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="30:00:30" />
</profiles>
</caching>
</system.webServer>
</configuration>
相关文章推荐
- IIS中User-mode caching引起的Cache-Control不为public的问题
- IIS中User-mode caching引起的Cache-Control不为public的问题
- user 'IIS APPPOOL\ASP.NET v4.0' error in IIS7问题的解决方法
- 删了sam文件后引起的IIS问题的解决方法
- FCKEditor 布署到IIS上出现的问题与解决方法
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- 解决DocType引起AjaxTookit的ModulPopup显示异常问题的方法
- IIS 配置ASP网站出现的问题和解决方法
- IIS出现提示“请求的资源在使用中”问题的解决方法
- dede织梦data目录正确迁移及引起的问题解决方法
- Access denied for user 'localhost'@'localhost' (using password: YES) 问题解决方法
- Linux修改fstab引起系统无法启动问题的解决方法
- web应用json转换引起jar包冲突的问题及解决方法
- 关于datepart计算weekday时多一天引起的问题及解决方法
- 把SATA模式由IDE模式改为AHCI引起系统启动蓝屏问题的解决方法
- window10 删除user个人文件后anaconda navigator 无法正常启动问题解决(猜测同系列方法类似)
- 异步 HttpContext.Current实现取值的方法(解决异步Application,Session,Cache...等失效的问题)
- java泛型编译时被擦除引起多态的破坏,用 桥方法解决此类问题。(java 桥方法)
- js代码开发引起的一系列问题及解决方法
- 【ASP.NET 问题】Win7中IIS被防火墙阻止导致外网无法访问的解决方法。