未验证 提交 8cdef191 编写于 作者: Q Quinn Chaffee 提交者: GitHub

`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
上级 54cb0161
......@@ -237,6 +237,11 @@ def stale?(object = nil, **freshness_kwargs)
# 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!(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册