<legend id='BAQFn'><style id='BAQFn'><dir id='BAQFn'><q id='BAQFn'></q></dir></style></legend>

    <bdo id='BAQFn'></bdo><ul id='BAQFn'></ul>
  • <tfoot id='BAQFn'></tfoot>

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

      1. <small id='BAQFn'></small><noframes id='BAQFn'>

      2. 我想与 304 响应一起发送哪些标头?

        What headers do I want to send together with a 304 response?(我想与 304 响应一起发送哪些标头?)
        1. <tfoot id='Zr3NT'></tfoot>

              <bdo id='Zr3NT'></bdo><ul id='Zr3NT'></ul>

                1. <small id='Zr3NT'></small><noframes id='Zr3NT'>

                    <tbody id='Zr3NT'></tbody>
                  <i id='Zr3NT'><tr id='Zr3NT'><dt id='Zr3NT'><q id='Zr3NT'><span id='Zr3NT'><b id='Zr3NT'><form id='Zr3NT'><ins id='Zr3NT'></ins><ul id='Zr3NT'></ul><sub id='Zr3NT'></sub></form><legend id='Zr3NT'></legend><bdo id='Zr3NT'><pre id='Zr3NT'><center id='Zr3NT'></center></pre></bdo></b><th id='Zr3NT'></th></span></q></dt></tr></i><div id='Zr3NT'><tfoot id='Zr3NT'></tfoot><dl id='Zr3NT'><fieldset id='Zr3NT'></fieldset></dl></div>
                2. <legend id='Zr3NT'><style id='Zr3NT'><dir id='Zr3NT'><q id='Zr3NT'></q></dir></style></legend>
                3. 本文介绍了我想与 304 响应一起发送哪些标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我发送 304 响应时.浏览器将如何解释我与 304 一起发送的其他标头?

                  When I send a 304 response. How will the browser interpret other headers which I send together with the 304?

                  例如

                  header("HTTP/1.1 304 Not Modified");
                  header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
                  

                  这会确保浏览器在 $offset 时间用完"之前不会发送另一个有条件的 GET 请求(也不会发送任何请求)?

                  Will this make sure the browser will not send another conditional GET request (nor any request) until $offset time has "run out"?

                  另外,其他标题呢?

                  我是否应该将这样的标头与 304 一起发送:

                  Should I send headers like this together with the 304:

                  header('Content-Type: text/html');
                  

                  我是否必须发送:

                  header("Last-Modified:" . $modified);
                  header('Etag: ' . $etag);
                  

                  确保浏览器在下一次 $offset 用完"时发送有条件的 GET 请求,还是只是保存旧的 Last Modified 和 Etag 值?

                  To make sure the browser sends a conditional GET request the next time the $offset has "run out" or does it simply save the old Last Modified and Etag values?

                  在发送 304 响应标头时我还应该注意其他事项吗?

                  Are there other things I should be aware about when sending a 304 response header?

                  推荐答案

                  这篇博文为了驯服有条件获得"野兽,我帮了很多忙.

                  This blog post helped me a lot in order to tame the "conditional get" beast.

                  一段有趣的摘录(部分与 Ben 的回答相矛盾)指出:

                  An interesting excerpt (which partially contradicts Ben's answer) states that:

                  如果正常响应包含 ETag 标头,则该标头也必须包含在 304 响应中.

                  If a normal response would have included an ETag header, that header must also be included in the 304 response.

                  缓存标头(Expires、Cache-Control 和/或 Vary),如果它们的值可能与先前响应中发送的值不同.

                  Cache headers (Expires, Cache-Control, and/or Vary), if their values might differ from those sent in a previous response.

                  这完全符合 RFC2616 秒 10.3.5.

                  低于 200 个请求...

                  Below a 200 request...

                  HTTP/1.1 200 OK
                  Server: nginx/0.8.52
                  Date: Thu, 18 Nov 2010 16:04:38 GMT
                  Content-Type: image/png
                  Last-Modified: Thu, 15 Oct 2009 02:04:11 GMT
                  Expires: Thu, 31 Dec 2010 02:04:11 GMT
                  Cache-Control: max-age=315360000
                  Accept-Ranges: bytes
                  Content-Length: 6394
                  Via: 1.1 proxyIR.my.corporate.proxy.name:8080 (IronPort-WSA/6.3.3-015)
                  Connection: keep-alive
                  Proxy-Connection: keep-alive
                  X-Junk: xxxxxxxxxxxxxxxx
                  

                  ...以及它的最佳有效 304 对应物.

                  ...And its optimal valid 304 counterpart.

                  HTTP/1.1 304 Not Modified
                  Server: nginx/0.8.52
                  Date: Thu, 18 Nov 2010 16:10:35 GMT
                  Expires: Thu, 31 Dec 2011 16:10:35 GMT
                  Cache-Control: max-age=315360000
                  Via: 1.1 proxyIR.my.corporate.proxy.name:8080 (IronPort-WSA/6.3.3-015)
                  Connection: keep-alive
                  Proxy-Connection: keep-alive
                  X-Junk: xxxxxxxxxxx
                  

                  请注意,Expires 标头最多为 Current Date + 一年,根据 RFC-2616 14.21.

                  Notice that the Expires header is at most Current Date + One Year as per RFC-2616 14.21.

                  这篇关于我想与 304 响应一起发送哪些标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  • <tfoot id='WwNOu'></tfoot>

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

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

                          • <bdo id='WwNOu'></bdo><ul id='WwNOu'></ul>
                              <tbody id='WwNOu'></tbody>
                            <legend id='WwNOu'><style id='WwNOu'><dir id='WwNOu'><q id='WwNOu'></q></dir></style></legend>