Skip to content

move info to a new include #11256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions http_cache/_expiration-and-validation.rst.inc
Original file line number Diff line number Diff line change
@@ -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
14 changes: 1 addition & 13 deletions http_cache/expiration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
14 changes: 1 addition & 13 deletions http_cache/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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