File tree Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Original file line number Diff line number Diff line change
1
+ .. sidebar:: Expiration and Validation
2
+
3
+ You can use both validation and expiration within the same ` ` Response` ` .
4
+ As expiration wins over validation, you can benefit from the best of
5
+ both worlds. In other words, by using both expiration and validation, you
6
+ can instruct the cache to serve the cached content, while checking back
7
+ at some interval (the expiration) to verify that the content is still valid.
8
+
9
+ .. tip::
10
+
11
+ You can also define HTTP caching headers for expiration and validation by using
12
+ annotations. See the ` FrameworkExtraBundle documentation` _.
13
+
14
+ .. _` FrameworkExtraBundle documentation` : https:// symfony .com / doc/ current/ bundles/ SensioFrameworkExtraBundle/ annotations/ cache .html
Original file line number Diff line number Diff line change @@ -12,18 +12,7 @@ until the cached response expires.
12
12
The expiration model can be accomplished using one of two, nearly identical,
13
13
HTTP headers: ``Expires `` or ``Cache-Control ``.
14
14
15
- .. sidebar :: Expiration and Validation
16
-
17
- You can use both validation and expiration within the same ``Response ``.
18
- As expiration wins over validation, you can benefit from the best of
19
- both worlds. In other words, by using both expiration and validation, you
20
- can instruct the cache to serve the cached content, while checking back
21
- at some interval (the expiration) to verify that the content is still valid.
22
-
23
- .. tip ::
24
-
25
- You can also define HTTP caching headers for expiration and validation by using
26
- annotations. See the `FrameworkExtraBundle documentation `_.
15
+ .. include :: /http_cache/_expiration-and-validation.rst.inc
27
16
28
17
.. index ::
29
18
single: Cache; Cache-Control header
@@ -92,5 +81,4 @@ servers should not send ``Expires`` dates more than one year in the future."
92
81
header is defined.
93
82
94
83
.. _`expiration model` : http://tools.ietf.org/html/rfc2616#section-13.2
95
- .. _`FrameworkExtraBundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html
96
84
.. _`RFC 7234 - Caching` : https://tools.ietf.org/html/rfc7234#section-4.2.1
Original file line number Diff line number Diff line change @@ -29,18 +29,7 @@ page again (see below for an implementation example).
29
29
Like with expiration, there are two different HTTP headers that can be used
30
30
to implement the validation model: ``ETag `` and ``Last-Modified ``.
31
31
32
- .. sidebar :: Expiration and Validation
33
-
34
- You can use both validation and expiration within the same ``Response ``.
35
- As expiration wins over validation, you can benefit from the best of
36
- both worlds. In other words, by using both expiration and validation, you
37
- can instruct the cache to serve the cached content, while checking back
38
- at some interval (the expiration) to verify that the content is still valid.
39
-
40
- .. tip ::
41
-
42
- You can also define HTTP caching headers for expiration and validation by using
43
- annotations. See the `FrameworkExtraBundle documentation `_.
32
+ .. include :: /http_cache/_expiration-and-validation.rst.inc
44
33
45
34
.. index ::
46
35
single: Cache; Etag header
@@ -231,4 +220,3 @@ headers that must not be present for ``304`` responses (see
231
220
232
221
.. _`expiration model` : https://tools.ietf.org/html/rfc2616#section-13.2
233
222
.. _`validation model` : http://tools.ietf.org/html/rfc2616#section-13.3
234
- .. _`FrameworkExtraBundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html
You can’t perform that action at this time.
0 commit comments