Skip to content

Commit

Permalink
Merge pull request #188 from Nyholm/patch-cache-key
Browse files Browse the repository at this point in the history
Adding docs about cache key generators.
  • Loading branch information
dbu committed Apr 5, 2017
2 parents d47ed02 + ca08979 commit c617efe
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit c617efe

Please sign in to comment.