Skip to content

Commit

Permalink
feature #5008 Added a note about how to enable http_method_override f…
Browse files Browse the repository at this point in the history
…or caching kernels (javiereguiluz)

This PR was squashed before being merged into the 2.3 branch (closes #5008).

Discussion
----------

Added a note about how to enable http_method_override for caching kernels

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | 2.3+
| Fixed tickets | #3569

Commits
-------

e719510 Added a note about how to enable http_method_override for caching kernels
  • Loading branch information
weaverryan committed Mar 14, 2015
2 parents 1ee04ba + e719510 commit 3c76623
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,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

// ...
$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

0 comments on commit 3c76623

Please sign in to comment.