File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -517,13 +517,18 @@ call::
517
517
'immutable' => true,
518
518
'last_modified' => new \DateTime(),
519
519
'etag' => 'abcdef',
520
+ 'terminate_on_cache_hit' => false,
520
521
]);
521
522
522
523
.. versionadded :: 6.1
523
524
524
525
The ``stale_if_error `` and ``stale_while_revalidate `` options were
525
526
introduced in Symfony 6.1.
526
527
528
+ .. versionadded :: 6.2
529
+
530
+ The ``terminate_on_cache_hit `` option was introduced in Symfony 6.2.
531
+
527
532
To check if the Response validators (``ETag ``, ``Last-Modified ``) match a
528
533
conditional value specified in the client Request, use the
529
534
:method: `Symfony\\ Component\\ HttpFoundation\\ Response::isNotModified `
Original file line number Diff line number Diff line change @@ -144,6 +144,22 @@ which the cache can serve a stale response when an error is encountered
144
144
(default: 60). This setting is overridden by the stale-if-error HTTP
145
145
Cache-Control extension (see RFC 5861).
146
146
147
+ terminate_on_cache_hit
148
+ ......................
149
+
150
+ **type **: ``boolean `` **default **: ``true ``
151
+
152
+ If ``true ``, the :ref: `kernel.terminate <component-http-kernel-kernel-terminate >`
153
+ event is dispatched even when the cache is hit.
154
+
155
+ Unless your application needs to process events on cache hits, it's recommended
156
+ to set this to ``false `` to improve performance, because it avoids having to
157
+ bootstrap the Symfony framework on a cache hit.
158
+
159
+ .. versionadded :: 6.2
160
+
161
+ The ``terminate_on_cache_hit `` option was introduced in Symfony 6.2.
162
+
147
163
.. _configuration-framework-http_method_override :
148
164
149
165
http_method_override
You can’t perform that action at this time.
0 commit comments