From 53128619fe42919df43eae593605871c45344f99 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Mon, 1 Apr 2019 08:37:40 +0200 Subject: [PATCH] move info to a new include --- http_cache/_expiration-and-validation.rst.inc | 14 ++++++++++++++ http_cache/expiration.rst | 14 +------------- http_cache/validation.rst | 14 +------------- 3 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 http_cache/_expiration-and-validation.rst.inc diff --git a/http_cache/_expiration-and-validation.rst.inc b/http_cache/_expiration-and-validation.rst.inc new file mode 100644 index 00000000000..26cc483845d --- /dev/null +++ b/http_cache/_expiration-and-validation.rst.inc @@ -0,0 +1,14 @@ +.. sidebar:: Expiration and Validation + + You can of course use both validation and expiration within the same ``Response``. + As expiration wins over validation, you can benefit from the best of both worlds. + In other words, by using both expiration and validation, you can instruct the cache + to serve the cached content, while checking back at some interval (the expiration) + to verify that the content is still valid. + + .. tip:: + + You can also define HTTP caching headers for expiration and validation by using + annotations. See the `FrameworkExtraBundle documentation`_. + +.. _`FrameworkExtraBundle documentation`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html diff --git a/http_cache/expiration.rst b/http_cache/expiration.rst index fa770a4fd29..ee2aedf0b19 100644 --- a/http_cache/expiration.rst +++ b/http_cache/expiration.rst @@ -12,18 +12,7 @@ until the cached response expires. The expiration model can be accomplished using one of two, nearly identical, HTTP headers: ``Expires`` or ``Cache-Control``. -.. sidebar:: Expiration and Validation - - You can of course use both validation and expiration within the same ``Response``. - As expiration wins over validation, you can benefit from the best of both worlds. - In other words, by using both expiration and validation, you can instruct the cache - to serve the cached content, while checking back at some interval (the expiration) - to verify that the content is still valid. - - .. tip:: - - You can also define HTTP caching headers for expiration and validation by using - annotations. See the `FrameworkExtraBundle documentation`_. +.. include:: /http_cache/_expiration-and-validation.rst.inc .. index:: single: Cache; Cache-Control header @@ -92,5 +81,4 @@ servers should not send ``Expires`` dates more than one year in the future." header is defined. .. _`expiration model`: http://tools.ietf.org/html/rfc2616#section-13.2 -.. _`FrameworkExtraBundle documentation`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html .. _`RFC 7234 - Caching`: https://tools.ietf.org/html/rfc7234#section-4.2.1 diff --git a/http_cache/validation.rst b/http_cache/validation.rst index 7cb99345aad..64fdf370579 100644 --- a/http_cache/validation.rst +++ b/http_cache/validation.rst @@ -29,18 +29,7 @@ page again (see below for an implementation example). Like with expiration, there are two different HTTP headers that can be used to implement the validation model: ``ETag`` and ``Last-Modified``. -.. sidebar:: Expiration and Validation - - You can of course use both validation and expiration within the same ``Response``. - As expiration wins over validation, you can benefit from the best of both worlds. - In other words, by using both expiration and validation, you can instruct the cache - to serve the cached content, while checking back at some interval (the expiration) - to verify that the content is still valid. - - .. tip:: - - You can also define HTTP caching headers for expiration and validation by using - annotations. See the `FrameworkExtraBundle documentation`_. +.. include:: /http_cache/_expiration-and-validation.rst.inc .. index:: single: Cache; Etag header @@ -231,4 +220,3 @@ headers that must not be present for ``304`` responses (see .. _`expiration model`: https://tools.ietf.org/html/rfc2616#section-13.2 .. _`validation model`: http://tools.ietf.org/html/rfc2616#section-13.3 -.. _`FrameworkExtraBundle documentation`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html