2015-10-07 57 views

回答

8

这在使用IIS出站重写规则的IIS 7+中是可能的。例如。如果要使所有.html页无效,请在web.config的outboundRules部分中创建以下出站规则(安装IIS重写模块后):

<outboundRules> 
    <rule name="AdjustCacheForHTMLPages" preCondition="IsHTMLFile"> 
    <match serverVariable="RESPONSE_Cache-Control" pattern=".*" /> 
    <action type="Rewrite" value="no-cache, no-store, must-revalidate" /> 
    </rule> 
    <preConditions> 
    <preCondition name="IsHTMLFile"> 
     <add input="{REQUEST_FILENAME}" pattern=".*\.html" /> 
    </preCondition> 
    </preConditions> 
</outboundRules>