Skip to content

Commit e719510

Browse files
javiereguiluzweaverryan
authored andcommitted
Added a note about how to enable http_method_override for caching kernels
1 parent e5dbd49 commit e719510

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

book/http_cache.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ kernel::
163163
The caching kernel will immediately act as a reverse proxy - caching responses
164164
from your application and returning them to the client.
165165

166+
.. caution::
167+
168+
By default, a kernel based on the cache ignores the ``framework.http_method_override``
169+
option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE``
170+
methods in HTTP requests.
171+
172+
Invoke the ``enableHttpMethodParameterOverride()`` method before creating the
173+
``Request`` object in order to take this option into account::
174+
175+
// web/app.php
176+
177+
// ...
178+
$kernel = new AppCache($kernel);
179+
180+
Request::enableHttpMethodParameterOverride(); // <-- add this line
181+
$request = Request::createFromGlobals();
182+
// ...
183+
166184
.. tip::
167185

168186
The cache kernel has a special ``getLog()`` method that returns a string

0 commit comments

Comments
 (0)