如何检查firefox中的预检结果缓存的内容 [英] How to check content of preflight result cache in firefox
问题描述
Firefox支持 http://www.w3.org/TR/cors/#preflight-结果缓存,如果是:
Does Firefox support http://www.w3.org/TR/cors/#preflight-result-cache and if yes:
- 如何检查其内容?
- 如何从资源缓存中分离它?
推荐答案
Mozilla没有提供太多信息,但它看起来像是缓存,但缓存没有一个很好的接口来清除它。 ( https://bugzilla.mozilla.org/show_bug.cgi?id=803438 显示了有关更改缓存列表的格式,所以它必须存在!)
Mozilla doesn't give much information, but it looks like it is cached, but that cache doesn't have a nice interface for clearing it. (https://bugzilla.mozilla.org/show_bug.cgi?id=803438 shows talking about changing the format of the cache list, so it must exist!)
话虽如此,如果你有控制服务器,你可以指定Access-Control-Max-Age以强制最大寿命。请参见 https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
Having said that, if you have control over the server, you can specify Access-Control-Max-Age to force a maximum lifespan. See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS.
此外,相关问题的答案表示Google Chrome将缓存限制为5分钟:http://stackoverflow.com/a/12021982/1180785 。
Also this answer to a related question says that Google Chrome limits the cache to 5 minutes: http://stackoverflow.com/a/12021982/1180785.
更新:Mozilla限制为24小时: http://monsur.hossa.in/2012/09/07/thoughts -on-the-cors-preflight-cache.html (他链接到的行号是过期的;现在是844)。还通过他引用的代码,它看起来像会在浏览器关闭时清除,但没有其他方法来清除它。我可能会错误。
Update: Mozilla has a limit of 24 hours: http://monsur.hossa.in/2012/09/07/thoughts-on-the-cors-preflight-cache.html (the line number he links to is out-of-date; it's 844 now). Also looking through the code he references, it looks like it will be cleared when the browser closes, but there is no other way to clear it. I could be mistaken though.
这篇关于如何检查firefox中的预检结果缓存的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!