<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00"/>
</staticContent>
</system.webServer>
</configuration>
注意:在开发环境配置web.config的clientCachel必须使用iis才可以看到效果
Web.Config clientCachel的API
https://msdn.microsoft.com/en-us/library/ms689443(v=vs.90).aspx
HTTP头的Expires与Cache-control说明
http://www.cnblogs.com/yuyii/archive/2008/10/16/1312238.html
配置完成后会观察到200(from cache,可以了解一下:
- HTTP 304(Not Modified)和200(from cache)的区别
- http响应Last-Modified和ETag