[ADP-143] Expires
Guidance
- SHOULD NOT use
Expires
header as it is not commonly recommended in modern API design.
Design Considerations
- The
Expires
header can be manipulated by changing the system time, potentially invalidating its intended purpose. - Browsers typically ignore the
Expires
header ifmax-age
is set (as a directive inCache-Control
). - The
Expires
header may affect the behavior ofLast-Modified
.
Best Practices
- Use
Cache-Control
header withmax-age
directive instead ofExpires
for more precise and reliable cache control. - If
Expires
must be used, combine it withCache-Control
to ensure consistent behavior across different clients. - Always consider the security implications of caching, especially for sensitive or frequently updated resources.
Implementation Example
http
Cache-Control: max-age=3600, public