Skip to content

Commit 44d3761

Browse files
committed
Minor tweaks
1 parent eb683ce commit 44d3761

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed

http_client.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,22 +1488,23 @@ in the foreach loop::
14881488
}
14891489
}
14901490

1491+
.. _http-client_caching:
1492+
14911493
Caching Requests and Responses
14921494
------------------------------
14931495

14941496
This component provides a :class:`Symfony\\Component\\HttpClient\\CachingHttpClient`
1495-
decorator that allows caching responses and serving them from the cache storage
1496-
for next requests as described in `RFC 9111`_.
1497+
decorator that enables caching of HTTP responses and serving them from cache
1498+
storage on subsequent requests, as described in `RFC 9111`_.
14971499

1498-
The implementation leverages a
1499-
:class:`tag aware cache <Symfony\\Contracts\\Cache\\TagAwareCacheInterface>` under the hood
1500-
so the :doc:`Cache component </components/cache>` needs to be
1501-
installed in your application.
1500+
Internally, it relies on a :class:`tag aware cache <Symfony\\Contracts\\Cache\\TagAwareCacheInterface>`,
1501+
so the :doc:`Cache component </components/cache>` must be installed in your application.
15021502

15031503
.. tip::
15041504

1505-
The implementation is asynchronous, so the response must be consumed
1506-
(e.g., via getContent() or streaming) for caching to occur.
1505+
The caching mechanism is asynchronous. The response must be fully consumed
1506+
(for example, by calling ``getContent()`` or using a stream) for it to be
1507+
stored in the cache.
15071508

15081509
.. configuration-block::
15091510

@@ -1586,14 +1587,15 @@ installed in your application.
15861587
15871588
.. tip::
15881589

1589-
It is also highly recommended to configure a :ref:`retry strategy <http-client-retry-failed-requests>`
1590-
to gracefully handle cache inconsistency.
1590+
It is strongly recommended to configure a
1591+
:ref:`retry strategy <http-client-retry-failed-requests>` to gracefully
1592+
handle temporary cache inconsistencies or validation failures.
15911593

15921594
.. versionadded:: 7.4
15931595

1594-
Compliance with `RFC 9111`_ and leveraging the
1595-
:doc:`Cache component </components/cache>` was introduced in Symfony 7.4.
1596-
Prior to this, it used ``HttpCache`` from the HttpKernel component.
1596+
In Symfony 7.4, caching was refactored to comply with `RFC 9111`_ and to
1597+
leverage the :doc:`Cache component </components/cache>`. In previous versions,
1598+
it relied on ``HttpCache`` from the HttpKernel component.
15971599

15981600
Limit the Number of Requests
15991601
----------------------------

reference/configuration/framework.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,8 +1666,8 @@ caching
16661666

16671667
**type**: ``array``
16681668

1669-
This option configures the behavior of the HTTP client caching, including which
1670-
types of requests to cache and how many times. The behavior is
1669+
This option configures the behavior of the :ref:`HTTP client caching <http-client_caching>`,
1670+
including which types of requests to cache and how many times. The behavior is
16711671
defined with the following options:
16721672

16731673
* :ref:`cache_pool <reference-http-client-caching-cache-pool>`
@@ -1710,27 +1710,38 @@ must implement the :class:`Symfony\\Contracts\\Cache\\TagAwareCacheInterface`.
17101710
By default, it uses an instance of :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter`
17111711
wrapping the ``cache.app`` pool.
17121712

1713+
.. versionadded:: 7.4
1714+
1715+
The ``cache_pool`` option was introduced in Symfony 7.4.
1716+
17131717
.. _reference-http-client-caching-shared:
17141718

17151719
shared
1716-
"""""""
1720+
""""""
17171721

17181722
**type**: ``boolean`` **default**: ``true``
17191723

1720-
Whether the cache is shared or private. If ``true``, the cache
1721-
is `shared <https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#shared_cache>`_
1722-
(default), if ``false``, the cache is
1723-
`private <https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#private_caches>`_.
1724+
If ``true``, it uses a `shared cache`_ so cached responses can be reused across
1725+
users. Set it to ``false`` to use a `private cache`_.
1726+
1727+
.. versionadded:: 7.4
1728+
1729+
The ``shared`` option was introduced in Symfony 7.4.
17241730

17251731
.. _reference-http-client-caching-max-ttl:
17261732

17271733
max_ttl
1728-
"""""""""
1734+
"""""""
17291735

17301736
**type**: ``integer`` **default**: ``null``
17311737

1732-
The maximum time-to-live (in seconds) for cached responses. Server-provided TTLs
1733-
are capped to this value if set.
1738+
The maximum time-to-live (in seconds) for cached responses. By default, responses
1739+
are cached for as long as the TTL specified by the server. When this option is
1740+
set, server-provided TTLs are capped to this value.
1741+
1742+
.. versionadded:: 7.4
1743+
1744+
The ``max_ttl`` option was introduced in Symfony 7.4.
17341745

17351746
cafile
17361747
......
@@ -4149,3 +4160,5 @@ to know their differences.
41494160
.. _`Link HTTP header`: https://tools.ietf.org/html/rfc5988
41504161
.. _`SMTP session`: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol#SMTP_transport_example
41514162
.. _`PHP attributes`: https://www.php.net/manual/en/language.attributes.overview.php
4163+
.. _`public cache`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#shared_cache
4164+
.. _`private cache`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#private_caches

0 commit comments

Comments
 (0)