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: docs/resp3_features.rst
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,3 +67,35 @@ This means that should you want to perform something, on a given push notificati
67
67
>> p = r.pubsub(push_handler_func=our_func)
68
68
69
69
In the example above, upon receipt of a push notification, rather than log the message, in the case where specific text occurs, an IOError is raised. This example, highlights how one could start implementing a customized message handler.
70
+
71
+
Client-side caching
72
+
-------------------
73
+
74
+
Client-side caching is a technique used to create high performance services.
75
+
It exploits the memory available on application servers, servers that are usually distinct computers compared to the database nodes, to store some subset of the database information directly in the application side.
76
+
For more information please check `official Redis documentation <https://redis.io/docs/latest/develop/use/client-side-caching/>`_.
77
+
Please notice that this feature only available with RESP3 protocol enabled in sync client only. Supported in standalone, Cluster and Sentinel clients.
78
+
79
+
Basic usage:
80
+
81
+
Enable caching with default configuration:
82
+
83
+
.. code:: python
84
+
85
+
>>>import redis
86
+
>>>from redis.cache import CacheConfig
87
+
>>> r = redis.Redis(host='localhost', port=6379, protocol=3, cache_config=CacheConfig())
88
+
89
+
The same interface applies to Redis Cluster and Sentinel.
90
+
91
+
Enable caching with custom cache implementation:
92
+
93
+
.. code:: python
94
+
95
+
>>>import redis
96
+
>>>from foo.bar import CacheImpl
97
+
>>> r = redis.Redis(host='localhost', port=6379, protocol=3, cache=CacheImpl())
98
+
99
+
CacheImpl should implement a `CacheInterface` specified in `redis.cache` package.
100
+
101
+
More robust documentation soon will be available at `official Redis documentation <https://redis.io/docs/latest/>`_.
0 commit comments