Skip to content

Added a note about how to enable http_method_override for caching kernels #5008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ kernel::
The caching kernel will immediately act as a reverse proxy - caching responses
from your application and returning them to the client.

.. caution::

By default, a kernel based on the cache ignores the ``framework.http_method_override``
option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE``
methods in HTTP requests.

Invoke the ``enableHttpMethodParameterOverride()`` method before creating the
``Request`` object in order to take this option into account::

// web/app.php

// ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be an empty line between a file comment and any other comment

$kernel = new AppCache($kernel);

Request::enableHttpMethodParameterOverride(); // <-- add this line
$request = Request::createFromGlobals();
// ...

.. tip::

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