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 of course use both validation and expiration within the same ` ` Response` ` .
4+ As expiration wins over validation, you can benefit from the best of both worlds.
5+ In other words, by using both expiration and validation, you can instruct the cache
6+ to serve the cached content, while checking back at some interval (the expiration)
7+ 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.
1212The expiration model can be accomplished using one of two, nearly identical,
1313HTTP headers: ``Expires `` or ``Cache-Control ``.
1414
15- .. sidebar :: Expiration and Validation
16-
17- You can of course use both validation and expiration within the same ``Response ``.
18- As expiration wins over validation, you can benefit from the best of both worlds.
19- In other words, by using both expiration and validation, you can instruct the cache
20- to serve the cached content, while checking back at some interval (the expiration)
21- 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
2716
2817.. index ::
2918 single: Cache; Cache-Control header
@@ -92,5 +81,4 @@ servers should not send ``Expires`` dates more than one year in the future."
9281 header is defined.
9382
9483.. _`expiration model` : http://tools.ietf.org/html/rfc2616#section-13.2
95- .. _`FrameworkExtraBundle documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html
9684.. _`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).
2929Like with expiration, there are two different HTTP headers that can be used
3030to implement the validation model: ``ETag `` and ``Last-Modified ``.
3131
32- .. sidebar :: Expiration and Validation
33-
34- You can of course use both validation and expiration within the same ``Response ``.
35- As expiration wins over validation, you can benefit from the best of both worlds.
36- In other words, by using both expiration and validation, you can instruct the cache
37- to serve the cached content, while checking back at some interval (the expiration)
38- 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
4433
4534.. index ::
4635 single: Cache; Etag header
@@ -231,4 +220,3 @@ headers that must not be present for ``304`` responses (see
231220
232221.. _`expiration model` : https://tools.ietf.org/html/rfc2616#section-13.2
233222.. _`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