`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:
Quinn Chaffee 2020-03-13 19:50:50 -06:00 committed by GitHub
parent 54cb01610e
commit 8cdef19142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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!(