You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/cache.rst
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,22 +33,34 @@ control headers from the server as specified in :rfc:`7234`. It needs a
33
33
[$cachePlugin]
34
34
);
35
35
36
+
.. note::
37
+
38
+
Since v1.3.0 does the ``CachePlugin`` have 2 factory methods to easily setup the plugin by caching type.
39
+
40
+
.. code-block:: php
41
+
42
+
$cachePlugin = CachePlugin::clientCache($pool, $streamFactory, $options); // Which allows caching responses with the 'private' or 'no-store' cache directive
43
+
$cachePlugin = CachePlugin::serverCache($pool, $streamFactory, $options); // Returns a cache plugin with the current default behavior
44
+
36
45
Options
37
46
-------
38
47
39
48
The third parameter to the ``CachePlugin`` constructor takes an array of options. The available options are:
| ``respect_response_cache_directives`` | ``['no-cache', 'private', 'max-age', 'no-store']`` | A list of cache directives to respect when caching responses |
0 commit comments