1、对应要设置的文件路径,设置时间365天
<?xml version="1.0" encoding="UTF-8"?>
<configuration><location path="reset.css">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
2、缓存某个文件夹下的所有内容
把这个内容放入到web.config里面,然后把这个web.config放至要缓存的文件夹下
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
3、缓存到哪一天
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Sat, 31 May 2014 07:00:00 GMT" />
</staticContent>
</system.webServer>
</configuration>
4、哪个文件缓存对哪天
<configuration>
<location path="Style.css">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Sat, 31 May 2014 04:00:00 GMT" />
</staticContent>
<httpProtocol allowKeepAlive="false" />
</system.webServer>
</location>
</configuration>
5、哪个文件缓存对哪天(日期的格式不一样)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="Style.css">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="2314.19:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>