@@ -42,6 +42,7 @@ def etag(&etagger)
42
42
#
43
43
# `:etag`
44
44
# : Sets a "weak" ETag validator on the response. See the `:weak_etag` option.
45
+ #
45
46
# `:weak_etag`
46
47
# : Sets a "weak" ETag validator on the response. Requests that specify an
47
48
# `If-None-Match` header may receive a `304 Not Modified` response if the
@@ -51,6 +52,7 @@ def etag(&etagger)
51
52
# they're good for caching HTML pages in browser caches. They can't be used
52
53
# for responses that must be byte-identical, like serving `Range` requests
53
54
# within a PDF file.
55
+ #
54
56
# `:strong_etag`
55
57
# : Sets a "strong" ETag validator on the response. Requests that specify an
56
58
# `If-None-Match` header may receive a `304 Not Modified` response if the
@@ -60,19 +62,23 @@ def etag(&etagger)
60
62
# byte. This is necessary for serving `Range` requests within a large video
61
63
# or PDF file, for example, or for compatibility with some CDNs that don't
62
64
# support weak ETags.
65
+ #
63
66
# `:last_modified`
64
67
# : Sets a "weak" last-update validator on the response. Subsequent requests
65
68
# that specify an `If-Modified-Since` header may receive a `304 Not
66
69
# Modified` response if `last_modified` <= `If-Modified-Since`.
70
+ #
67
71
# `:public`
68
72
# : By default the `Cache-Control` header is private. Set this option to
69
73
# `true` if you want your application to be cacheable by other devices, such
70
74
# as proxy caches.
75
+ #
71
76
# `:cache_control`
72
77
# : When given, will overwrite an existing `Cache-Control` header. For a list
73
78
# of `Cache-Control` directives, see the [article on
74
79
# MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Contr
75
80
# ol).
81
+ #
76
82
# `:template`
77
83
# : By default, the template digest for the current controller/action is
78
84
# included in ETags. If the action renders a different template, you can
@@ -244,10 +250,13 @@ def stale?(object = nil, **freshness_kwargs)
244
250
# `:public`
245
251
# : If true, replaces the default `private` directive with the `public`
246
252
# directive.
253
+ #
247
254
# `:must_revalidate`
248
255
# : If true, adds the `must-revalidate` directive.
256
+ #
249
257
# `:stale_while_revalidate`
250
258
# : Sets the value of the `stale-while-revalidate` directive.
259
+ #
251
260
# `:stale_if_error`
252
261
# : Sets the value of the `stale-if-error` directive.
253
262
#
@@ -306,7 +315,6 @@ def expires_now
306
315
# * `public`: By default, HTTP responses are private, cached only on the
307
316
# user's web browser. To allow proxies to cache the response, set `true` to
308
317
# indicate that they can serve the cached response to all users.
309
- #
310
318
def http_cache_forever ( public : false )
311
319
expires_in 100 . years , public : public
312
320
0 commit comments