Skip to content

Commit ead414b

Browse files
committed
minor. refs symfony#14683
1 parent 78dd1cd commit ead414b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

components/cache/adapters/redis_adapter.rst

+11-6
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,21 @@ In order to use tag-based invalidation, you can wrap your adapter in :class:`Sym
204204
Configuring Redis
205205
~~~~~~~~~~~~~~~~~
206206

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
213216
214217
maxmemory 100mb
215218
maxmemory-policy allkeys-lru
216219
220+
Read more about this topic in the offical `Redis LRU Cache Documentation`_.
221+
217222
.. _`Data Source Name (DSN)`: https://en.wikipedia.org/wiki/Data_source_name
218223
.. _`Redis server`: https://redis.io/
219224
.. _`Redis`: https://github.com/phpredis/phpredis

0 commit comments

Comments
 (0)