Skip to content

Commit 75febdc

Browse files
mpdudewouterj
authored andcommitted
[HttpKernel] Document trace_level and trace_header config options in HttpCache
1 parent 337a9e2 commit 75febdc

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

http_cache.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,26 @@ For a full list of the options and their meaning, see the
155155

156156
When you're in debug mode (the second argument of ``Kernel`` constructor in the
157157
front controller is ``true``), Symfony automatically adds an ``X-Symfony-Cache``
158-
header to the response. Use this to get information about cache hits and misses.
158+
header to the response. You can also use the ``trace_level`` config
159+
option and set it to either ``none``, ``short`` or ``full`` to
160+
add this information.
161+
162+
``short`` will add the information for the master request only.
163+
It's written in a concise way that makes it easy to record the
164+
information in your server log files. For example, in Apache you can
165+
use ``%{X-Symfony-Cache}o`` in ``LogFormat`` format statements.
166+
This information can be used to extract general information about
167+
cache efficiency of your routes.
168+
169+
.. tip::
170+
171+
You can change the name of the header used for the trace
172+
information using the ``trace_header`` config option.
173+
174+
.. versionadded:: 4.3
175+
176+
The ``trace_level`` and ``trace_header`` configuration options
177+
were introduced in Symfony 4.3.
159178

160179
.. _http-cache-symfony-versus-varnish:
161180

0 commit comments

Comments
 (0)