@@ -265,6 +265,9 @@ following methods::
265265 // you can get individual info too
266266 $startTime = $response->getInfo('start_time');
267267
268+ ..tip ::
269+ Call ``$response->getInfo('debug') `` to get detailed logs about the HTTP transaction.
270+
268271.. _http-client-streaming-responses :
269272
270273Streaming Responses
@@ -316,17 +319,23 @@ When the HTTP status code of the response is in the 300-599 range (i.e. 3xx,
316319Caching Requests and Responses
317320------------------------------
318321
319- This component provides a special HTTP client via the
320- :class: `Symfony\\ Component\\ HttpClient\\ CachingHttpClient ` class to cache
321- requests and their responses. The actual HTTP caching is implemented using the
322- :doc: `HttpKernel component </components/http_kernel >`, so make sure it's
323- installed in your application.
322+ This component provides a:class: `Symfony\\ Component\\ HttpClient\\ CachingHttpClient `
323+ decorator that allows caching responses and serving them from the local storage
324+ for next requests. The implementation leverages the
325+ :class: `Symfony\\ Component\\ HttpKernel\\ HttpCache\\ HttpCache ` class under the hood
326+ so that the:doc: `HttpKernel component </components/http_kernel >` needs to be
327+ installed in your application::
324328
325- ..
326- .. TODO:
327- .. Show some example of caching requests+responses
328- ..
329- ..
329+ use Symfony\Component\HttpClient\HttpClient;
330+ use Symfony\Component\HttpClient\CachingHttpClient;
331+ use Symfony\Component\HttpKernel\HttpCache\Store;
332+
333+ $store = new Store('/path/to/cache/storage/');
334+ $client = HttpClient::create();
335+ $client = new CachingHttpClient($client, $store);
336+
337+ // this won't hit the network if the resource is already in the cache
338+ $response = $client->request('GET', 'https://example.com/cacheable-resource');
330339
331340Scoping Client
332341--------------