Skip to content
Merged
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
12 changes: 12 additions & 0 deletions plugins/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ The third parameter to the ``CachePlugin`` constructor takes an array of options
+---------------------------------------+----------------------------------------------------+-----------------------------------------------------------------------+
| ``respect_response_cache_directives`` | ``['no-cache', 'private', 'max-age', 'no-store']`` | A list of cache directives to respect when caching responses |
+---------------------------------------+----------------------------------------------------+-----------------------------------------------------------------------+
| ``cache_key_generator`` | ``new SimpleGenerator()`` | A class implementing ``CacheKeyGenerator`` to generate a PSR-6 cache |
| | | key. |
+---------------------------------------+----------------------------------------------------+-----------------------------------------------------------------------+

.. note::

Expand All @@ -89,6 +92,15 @@ for the default time to live. The options below will cache all responses for one
'respect_response_cache_directives' => [],
];


Generating a cache key
``````````````````````

You may define a method how the PSR-6 cache key should be generated. The default generator is ``SimpleGenerator`` which
is using the request method, URI and body of the request. The cache plugin does also include a ``HeaderCacheKeyGenerator``
which allow you to specify what HTTP header you want include in the cache key.


Semantics of null values
````````````````````````

Expand Down