代码之家  ›  专栏  ›  技术社区  ›  Chris

web.config文件为所有html文件设置标题

  •  0
  • Chris  · 技术社区  · 7 年前

    我不想为我的项目中的所有html文件设置缓存头。我知道如何对特定文件执行此操作:

     <location path="index.html">
        <system.webServer>
          <httpProtocol>
            <customHeaders>
                <add name="Cache-Control" value="no-cache, no-store, must-revalidate" />
                <add name="Pragma" value="no-cache" />
                <add name="Expires" value="0" />
            </customHeaders>
          </httpProtocol>
        </system.webServer>
      </location>
    

    0 回复  |  直到 7 年前