2015-10-07 26 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>