Skip to content

Commit 8da332e

Browse files
committed
Merge branch '4.2'
* 4.2: move info to a new include
2 parents 49b0696 + e7ef09a commit 8da332e

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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

http_cache/expiration.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ until the cached response expires.
1212
The expiration model can be accomplished using one of two, nearly identical,
1313
HTTP headers: ``Expires`` or ``Cache-Control``.
1414

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
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

http_cache/validation.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@ page again (see below for an implementation example).
2929
Like with expiration, there are two different HTTP headers that can be used
3030
to implement the validation model: ``ETag`` and ``Last-Modified``.
3131

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
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

0 commit comments

Comments
 (0)