mirror of https://github.com/rails/rails
`expires_in` `extras` documentation (#38625)
* `expires_in` `extras` documentation Wanted to find how to add `s-maxage` and stumbled across this feature. Wanted to document it for others, but many proxies like Akamai are very insistent on using `s-maxage` rather than `max-age`. * Altered verbiage and fixed spelling
This commit is contained in:
parent
54cb01610e
commit
8cdef19142
|
@ -237,6 +237,11 @@ module ActionController
|
|||
# expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds
|
||||
# expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes
|
||||
#
|
||||
# HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
||||
# Any additional key-value pairs are concatenated onto the `Cache-Control` header in the response:
|
||||
#
|
||||
# expires_in 3.hours, public: true, "s-maxage": 3.hours, "no-transform": true
|
||||
#
|
||||
# The method will also ensure an HTTP Date header for client compatibility.
|
||||
def expires_in(seconds, options = {})
|
||||
response.cache_control.merge!(
|
||||
|
|
Loading…
Reference in New Issue