<small id='MuHI2'></small><noframes id='MuHI2'>

  • <i id='MuHI2'><tr id='MuHI2'><dt id='MuHI2'><q id='MuHI2'><span id='MuHI2'><b id='MuHI2'><form id='MuHI2'><ins id='MuHI2'></ins><ul id='MuHI2'></ul><sub id='MuHI2'></sub></form><legend id='MuHI2'></legend><bdo id='MuHI2'><pre id='MuHI2'><center id='MuHI2'></center></pre></bdo></b><th id='MuHI2'></th></span></q></dt></tr></i><div id='MuHI2'><tfoot id='MuHI2'></tfoot><dl id='MuHI2'><fieldset id='MuHI2'></fieldset></dl></div>
    <tfoot id='MuHI2'></tfoot>

      <bdo id='MuHI2'></bdo><ul id='MuHI2'></ul>
        <legend id='MuHI2'><style id='MuHI2'><dir id='MuHI2'><q id='MuHI2'></q></dir></style></legend>

        如何设置 httpexpires 和 cachecontrol 标头

        how to set up both httpexpires and cachecontrol headers(如何设置 httpexpires 和 cachecontrol 标头)
        <legend id='7g0A4'><style id='7g0A4'><dir id='7g0A4'><q id='7g0A4'></q></dir></style></legend>
          <bdo id='7g0A4'></bdo><ul id='7g0A4'></ul>

            <tfoot id='7g0A4'></tfoot>

                <small id='7g0A4'></small><noframes id='7g0A4'>

                    <tbody id='7g0A4'></tbody>
                  <i id='7g0A4'><tr id='7g0A4'><dt id='7g0A4'><q id='7g0A4'><span id='7g0A4'><b id='7g0A4'><form id='7g0A4'><ins id='7g0A4'></ins><ul id='7g0A4'></ul><sub id='7g0A4'></sub></form><legend id='7g0A4'></legend><bdo id='7g0A4'><pre id='7g0A4'><center id='7g0A4'></center></pre></bdo></b><th id='7g0A4'></th></span></q></dt></tr></i><div id='7g0A4'><tfoot id='7g0A4'></tfoot><dl id='7g0A4'><fieldset id='7g0A4'></fieldset></dl></div>
                  本文介绍了如何设置 httpexpires 和 cachecontrol 标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在 web.config 中设置 expires 和 cachecontrolhttpExpires 标头按照该问题的答案Expires 和 Cache-control:max-age 有什么区别?

                  I want to set up both expires and cachecontrol and httpExpires headers in web.config by following the answer on that question What's the difference Expires and Cache-control:max-age?

                       <system.webServer>
                          <staticContent>
                              <clientCache cacheControlCustom="public" cacheControlMaxAge="12:00:00" cacheControlMode="UseMaxAge" />
                              <clientCache cacheControlCustom="public" httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" cacheControlMode="UseExpires" />
                          </staticContent>
                      </system.webServer>
                  

                  但由于某种原因,当我这样做时,图像变得不可用.

                  But for some reason images became not available when I am doing that.

                  我有 Failed to load resource: 服务器响应状态为 500 (Internal Server Error) 每次图像加载错误(我可以在 浏览器开发工具中看到错误控制台).

                  I've got Failed to load resource: the server responded with a status of 500 (Internal Server Error) error on each image load (I can see that errors in browser dev tools console).

                  我猜我配置错了?

                  如果我通过只留下一个来评论任何 clientCache 部分,它会起作用

                  It would work if I comment any of clientCache section by leaving only single one

                  如何解决?

                  更新:刚刚问了另一个相关问题 如何设置httpexpires 和 cachecontrol 标头 web.cofig:

                  UPDATED: Just asked one more related question how to set up both httpexpires and cachecontrol headers web.cofig:

                  推荐答案

                  这个 IIS 客户端缓存页面 声明虽然Expires"和max-age"设置有些类似,但max-age"指令优先于Expires".但是,当一个max-age"clientCache 条目与一个Expires"clientCache 条目并行使用时,IIS 会生成 HTTP 500 错误.

                  This IIS Client Cache page states that 'While the "Expires" and "max-age" settings are somewhat analagous, the "max-age" directive takes priority over "Expires"'. However, IIS generates HTTP 500 errors when one "max-age" clientCache entry was used in parallel with an "Expires" clientCache entry.

                  在 IIS 中调整Set Common Headers"时,Expires"和max-age"相互排斥.您可以使用其中一种,但不能同时使用.

                  The "Expires" and "max-age" are mutually exclusive of one another when adjusting the "Set Common Headers" in IIS. You can use one or the other, but not both.

                  其他缓存指令可以应用于 Web.config 中的子文件夹或特定文件.请参阅此 stackoverflow 页面关于在 IIS7 中配置缓存内容.

                  Other cache directives can be applied to subfolders or specific files in Web.config. See this stackoverflow page on configuring cache content in IIS7.

                  这篇关于如何设置 httpexpires 和 cachecontrol 标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding HTTP Headers and Post data in a System.Windows.Forms.WebBrowser(在 System.Windows.Forms.WebBrowser 中添加 HTTP 标头和发布数据)
                  Adding headers in ASP.NET MVC 3(在 ASP.NET MVC 3 中添加标头)
                  Response.Redirect strips Header Referrer - Possible to Add it Back?(Response.Redirect 剥离 Header Referrer - 可以将其添加回来吗?)
                  Add Custom Headers using HttpWebRequest(使用 HttpWebRequest 添加自定义标头)
                  Faking browser request in ASP.net C#(在 ASP.net C# 中伪造浏览器请求)
                  How to delete IIS custom headers like X-Powered-By: ASP.NET from response?(如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?)

                  <small id='Mkx1r'></small><noframes id='Mkx1r'>

                    <tbody id='Mkx1r'></tbody>

                    <i id='Mkx1r'><tr id='Mkx1r'><dt id='Mkx1r'><q id='Mkx1r'><span id='Mkx1r'><b id='Mkx1r'><form id='Mkx1r'><ins id='Mkx1r'></ins><ul id='Mkx1r'></ul><sub id='Mkx1r'></sub></form><legend id='Mkx1r'></legend><bdo id='Mkx1r'><pre id='Mkx1r'><center id='Mkx1r'></center></pre></bdo></b><th id='Mkx1r'></th></span></q></dt></tr></i><div id='Mkx1r'><tfoot id='Mkx1r'></tfoot><dl id='Mkx1r'><fieldset id='Mkx1r'></fieldset></dl></div>
                    <tfoot id='Mkx1r'></tfoot>
                    • <bdo id='Mkx1r'></bdo><ul id='Mkx1r'></ul>
                      • <legend id='Mkx1r'><style id='Mkx1r'><dir id='Mkx1r'><q id='Mkx1r'></q></dir></style></legend>