Expires
头指定了一个日期/时间, 在这个日期/时间之后,HTTP响应被认为是过时的;
无效的日期,比如 0, 代表着一个过去的事件,即该资源已经过期了。
如果还有一个 设置了 "max-age" 或者 "s-max-age" 指令的Cache-Control
响应头,那么 Expires
头就会被忽略。
Header type | Response header |
---|---|
Forbidden header name | no |
CORS-safelisted response-header | yes |
Syntax
Expires: <http-date>
Directives
- <http-date>
-
一个 HTTP-date 时间戳
Examples
Expires: Wed, 21 Oct 2015 07:28:00 GMT
Specifications
Specification | Title |
---|---|
RFC 7234, section 5.3: Expires | Hypertext Transfer Protocol (HTTP/1.1): Caching |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Servo |
---|---|---|---|---|---|---|---|
Expires | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge Mobile | Firefox for Android | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Expires | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |