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

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

  1. <tfoot id='UVLRF'></tfoot>

      哪些浏览器在缓存 XMLHTTPRequest 响应时存在问题?

      时间:2023-05-15
        <i id='aiojJ'><tr id='aiojJ'><dt id='aiojJ'><q id='aiojJ'><span id='aiojJ'><b id='aiojJ'><form id='aiojJ'><ins id='aiojJ'></ins><ul id='aiojJ'></ul><sub id='aiojJ'></sub></form><legend id='aiojJ'></legend><bdo id='aiojJ'><pre id='aiojJ'><center id='aiojJ'></center></pre></bdo></b><th id='aiojJ'></th></span></q></dt></tr></i><div id='aiojJ'><tfoot id='aiojJ'></tfoot><dl id='aiojJ'><fieldset id='aiojJ'></fieldset></dl></div>

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

              <tfoot id='aiojJ'></tfoot>
                <tbody id='aiojJ'></tbody>
              1. <small id='aiojJ'></small><noframes id='aiojJ'>

                本文介绍了哪些浏览器在缓存 XMLHTTPRequest 响应时存在问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                目前流行的浏览器是否存在缓存* XMLHttpRequest 响应的特殊问题,我需要注意这些问题?

                Do any of the currently popular browsers have particular problems caching* XMLHttpRequest responses that I need to be aware of?

                我希望能够在每个页面上包含 XMLHttpRequest 查询,作为动态加载与页面类型相关的内容(即 JSON)或行为(如 eval()ed Javascript)的方法,但想确保如果服务器发送了正确的标头,它从服务器接收的资源可以被缓存.

                I'd like to be able to include XMLHttpRequest queries on every page as a method of dynamically loading content (ie JSON) or behaviour (like eval()ed Javascript) relevant to the type of page, but wanted to make sure that the resources it receives from the server could be cached, if the server sent the right headers.

                我担心阅读 这篇文章Firefox 1.1 等浏览器不会缓存通过 XMLHTTPRequest 获得的任何内容,并且无论服务器发送的标头如何,它总是会完全发送新数据(使用 Cache-Control 且没有 If-Modified-Since).

                I was concerned to read this article which mentions that browsers such as Firefox 1.1 do not cache any content obtained via XMLHTTPRequest, and that it always requests new data is sent completely (with Cache-Control and no If-Modified-Since) regardless of headers sent by the server.

                显然那篇文章已经很老了——我什至不记得有 Firefox 1.1;那么对于当前流行的浏览器,我需要考虑哪些因素?当我特别想要缓存响应时有什么技巧吗?

                Obviously that article is very old - I don't even remember a Firefox 1.1; so what are the considerations I need to make for current popular browsers and is there any trick for when I specifically want responses to be cached?

                **为了澄清我的问题,缓存是指客户端缓存,其中服务器发布新鲜信息(以 Cache-Control: max-age 指令或 Expires: 标头的形式)并且浏览器存储在其缓存中的响应副本以及到期日期,以便可以从浏览器缓存中满足从后续页面发出的相同资源的未来请求,而根本不需要与服务器进行任何联系.所有主流浏览器都对大多数内容正确执行此操作,但我听说 Firefox 无法对 XMLHttpRequest 内容执行此操作.我要问的是,是否有人知道任何现代浏览器在使用 XMLHttpRequest 时不根据规范缓存响应的情况.*

                **To clarify my question, by caching, I mean client-side caching, where the server issues freshness information (in the form of a Cache-Control: max-age directive or an Expires: header) and the browser stores a copy of the response in its cache along with an expiry date, so that future requests for the same resource issued from subsequent pages can be satisfied from the browser cache without the need for any contact with the server at all. All major browsers do this correctly for most content, but I've heard that Firefox cannot do this for XMLHttpRequest content. What I'm asking is if anyone knows of cases where any of the modern browsers do not cache responses according to the spec when using XMLHttpRequest.*

                推荐答案

                Mark Nottingham 有 an一组出色的功能测试,展示了浏览器 XMLHttpRequest 缓存行为.在您想要支持的浏览器中加载页面,并确定您可以依赖哪些技术以及不能依赖哪些技术来缓存您的响应.

                Mark Nottingham has an excellent set of functional tests that demonstrate browser XMLHttpRequest caching behaviour. Load up the page in the browsers you want to support and work out what techniques you can and cannot rely on to have your response cached.

                这篇关于哪些浏览器在缓存 XMLHTTPRequest 响应时存在问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:使用 AJAX (XMLHttpRequest) 查询 Wikipedia 的 API 下一篇:如何检索 AMD 化 Dojo 的 XHR 响应代码(+时间戳)?

                相关文章

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

                  <legend id='QYryx'><style id='QYryx'><dir id='QYryx'><q id='QYryx'></q></dir></style></legend>
                  1. <tfoot id='QYryx'></tfoot>
                      <bdo id='QYryx'></bdo><ul id='QYryx'></ul>

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