最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

IIS7、iis7.5中禁止緩存單個靜態(tài)文件的配置方法

 更新時間:2017年02月26日 23:26:52   作者:桃子夭夭  
這篇文章主要介紹了IIS7、iis7.5中禁止緩存單個靜態(tài)文件的配置方法,需要的朋友可以參考下

IIS7中,想將一個經(jīng)常修改的靜態(tài)文件設(shè)置為不可緩存,在IIS配置界面里怎么也找不到...

一番google之后在stackoverflow里邊發(fā)現(xiàn)了這樣一段回答,最終解決了問題:

一、單個文件的禁止緩存的方法

just stumbled across this question; you can use the following to disable the cache on a specific file:
偶爾看到這個問題,你可以通過下面的方法來對單個文件進(jìn)行禁止緩存

<configuration>
 <location path="path/to/the/file">
  <system.webServer>
   <staticContent>
    <clientCache cacheControlMode="DisableCache" />
   </staticContent>
  </system.webServer>
 </location>
</configuration>

(Note that the path is relative to the web.config file)
注意路徑的寫法需要相對于web.config文件的路徑
Alternatively, place the single file in a directory on it's own, and give that directory it's own web.config that disables caching for everything in it;
或者是將這個文件放一個單獨(dú)的目錄里面,然后通過它自己的web.config文件來禁用緩存。

二、通過將文件放到一個目錄里面進(jìn)行設(shè)置,這個目錄里的文件都不會緩存

<configuration>
 <system.webServer>
  <httpProtocol>
   <customHeaders>
    <add name="Cache-Control" value="no-cache" />
   </customHeaders>
  </httpProtocol>
 </system.webServer>
</configuration>

[Both tested on IIS7.5 on Windows 7, but you'll have to confirm that it works OK on Azure]
在win7中的iis7.5緩存也測試過,不過你需要確認(rèn)他在Azure能否正常運(yùn)行。

相關(guān)文章

最新評論

大荔县| 高要市| 缙云县| 泽普县| 遵义市| 石棉县| 睢宁县| 罗甸县| 全椒县| 县级市| 高淳县| 洛宁县| 南木林县| 洛南县| 金门县| 十堰市| 航空| 汤阴县| 永吉县| 友谊县| 德安县| 凤凰县| 普定县| 同心县| 香格里拉县| 沙雅县| 万荣县| 藁城市| 博客| 双辽市| 通江县| 新余市| 石棉县| 闸北区| 西藏| 康马县| 连云港市| 五原县| 武山县| 满城县| 东乡|