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: components/cache/adapters/redis_adapter.rst
+11-6
Original file line number
Diff line number
Diff line change
@@ -204,16 +204,21 @@ In order to use tag-based invalidation, you can wrap your adapter in :class:`Sym
204
204
Configuring Redis
205
205
~~~~~~~~~~~~~~~~~
206
206
207
-
When using Redis as cache, you should configure the `maxmemory` and `maxmemory-policy` settings.
208
-
Read more about this topic in the offical `Redis LRU Cache Documentation`_.
209
-
By setting `maxmemory`, you limit how much memory Redis is allowed to consume. If the amount is too low, Redis will drop entries that would still be useful and you benefit less from your cache. Setting the `maxmemory-policy` to
210
-
`allkeys-lru` tells Redis that it is ok to drop data when it runs out of memory, and to first drop the oldest entries (least
211
-
recently used). If you do not allow Redis to drop entries, it will return an error when you try to add data when no
212
-
memory is available. An example setting could look as follows:
207
+
When using Redis as cache, you should configure the ``maxmemory`` and ``maxmemory-policy``
208
+
settings. By setting ``maxmemory``, you limit how much memory Redis is allowed to consume.
209
+
If the amount is too low, Redis will drop entries that would still be useful and you benefit
210
+
less from your cache. Setting the ``maxmemory-policy`` to ``allkeys-lru`` tells Redis that
211
+
it is ok to drop data when it runs out of memory, and to first drop the oldest entries (least
212
+
recently used). If you do not allow Redis to drop entries, it will return an error when you
213
+
try to add data when no memory is available. An example setting could look as follows:
214
+
215
+
.. code-block:: ini
213
216
214
217
maxmemory 100mb
215
218
maxmemory-policy allkeys-lru
216
219
220
+
Read more about this topic in the offical `Redis LRU Cache Documentation`_.
221
+
217
222
.. _`Data Source Name (DSN)`: https://en.wikipedia.org/wiki/Data_source_name
0 commit comments