Access-Control-Max-Age
Access-Control-Max-Age响应 header 指示多长时间的结果预检请求(即包含在所述信息Access-Control-Allow-Methods和Access-Control-Allow-Headers的 headers )可以被缓存。
Header type | Response header |
|---|---|
Forbidden header name | no |
语法
Access-Control-Max-Age: <delta-seconds>指令
<delta-seconds> 结果可以被缓存的最大秒数。
值为-1将禁用缓存,需要对所有呼叫进行预检选项检查。
例子
将预检请求的结果缓存10分钟:
Access-Control-Max-Age: 600 规范
Specification | Status | Comment |
|---|---|---|
FetchThe definition of 'Access-Control-Max-Age' in that specification. | Living Standard | Initial definition. |
浏览器兼容性
Feature | Chrome | Firefox | Edge | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
Basic Support | 4 | 3.5 | 12 | 10 | 12 | 4 |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
Basic Support | 2.1 | (Yes) | (Yes) | 1.0 | (Yes) | 12 | 3.2 |
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

