We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

The Access-Control-Max-Age 这个响应首部表示 preflight request  (预检请求)的返回结果(即 Access-Control-Allow-MethodsAccess-Control-Allow-Headers 提供的信息) 可以被缓存多久。

报头类型 Response header
Forbidden header name no

语法

Access-Control-Max-Age: <delta-seconds>

指令

<delta-seconds>
返回结果可以用于缓存的最长时间,单位是秒。在Firefox中,上限是24小时 (即86400秒),而在Chromium 中则是10分钟(即600秒)。Chromium 同时规定了一个默认值 5 秒。
如果值为 -1,则表示禁用缓存,每一次请求都需要提供预检请求,即用OPTIONS请求进行检测。

示例

将预检请求的结果缓存10分钟:

Access-Control-Max-Age: 600 

规范

规范 状态 注释
Fetch
Access-Control-Max-Age
Living Standard Initial definition.

浏览器兼容性

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support4123.510124
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support2.1 Yes Yes4123.2 Yes

相关内容

<weel class="_on" data-api-src="google" data-check-aim="false" data-lang-from="en" data-lang-to="zh" id="weel__float-action-button" style="visibility: hidden; opacity: 0; transform: translate3d(664px, 801px, 0px);"><weel id="weel__float-action-button--container"><weel id="weel__float-action-button--icon"></weel></weel></weel><weel class="_reverse _on" id="weel__float-action-panel" style="visibility: hidden; opacity: 0; transform: translate3d(65.05px, 801px, 0px);"><weel id="weel__float-action-panel--container" style="left: -97px;"><weel id="weel__float-action-panel--output-stream"><weel id="weel__float-action-panel--output-stream-result"><weel id="weel__float-action-panel--output-stream-result-word"><weel id="weel__float-action-panel--output-stream-phonetic"><weel id="weel__float-action-panel--i-voice"></weel><weel id="weel__float-action-panel--output-stream-phonetic-plain">[ ... ]</weel></weel><weel id="weel__float-action-panel--output-stream-explain"><weel id="weel__float-action-panel--i-copy"></weel><weel id="weel__float-action-panel--output-stream-explain-plain">评论</weel><weel class="_on" id="weel__float-action-panel--output-stream-explain-detail">评论

注解
议论
解说
品评


诠释
讲解
诠</weel></weel></weel></weel></weel></weel></weel>

文档标签和贡献者

此页面的贡献者: crper, WayneCui
最后编辑者: crper,