Skip to content

Commit 3f6ce69

Browse files
[Cache] add Redis options compression and tcp_keepalive
1 parent 2a3a68a commit 3f6ce69

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/cache/adapters/redis_adapter.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ array of ``key => value`` pairs representing option names and their respective v
9696

9797
// associative array of configuration options
9898
array(
99+
'compression' => true,
99100
'lazy' => false,
100101
'persistent' => 0,
101102
'persistent_id' => null,
103+
'tcp_keepalive' => 0,
102104
'timeout' => 30,
103105
'read_timeout' => 0,
104106
'retry_interval' => 0,
@@ -114,6 +116,10 @@ Available Options
114116
If none is specified, it will return ``\Redis`` if the ``redis`` extension is
115117
available, and ``\Predis\Client`` otherwise.
116118

119+
``compression`` (type: ``bool``, default: ``true``)
120+
Enables or disables compression of items. This requires phpredis v4 or higher with
121+
LZF support enabled.
122+
117123
``lazy`` (type: ``bool``, default: ``false``)
118124
Enables or disables lazy connections to the backend. It's ``false`` by
119125
default when using this as a stand-alone component and ``true`` by default
@@ -134,6 +140,10 @@ Available Options
134140
Specifies the delay (in milliseconds) between reconnection attempts in case the client
135141
loses connection with the server.
136142

143+
``tcp_keepalive`` (type: ``int``, default: ``0``)
144+
Specifies the TCP-keepalive timeout of the connection. This requires phpredis v4 or
145+
higher and a TCP-keepalive enabled server.
146+
137147
``timeout`` (type: ``int``, default: ``30``)
138148
Specifies the time (in seconds) used to connect to a Redis server before the
139149
connection attempt times out.
@@ -149,3 +159,4 @@ Available Options
149159
.. _`RedisCluster`: https://github.com/phpredis/phpredis/blob/master/cluster.markdown#readme
150160
.. _`Predis`: https://packagist.org/packages/predis/predis
151161
.. _`Predis Connection Parameters`: https://github.com/nrk/predis/wiki/Connection-Parameters#list-of-connection-parameters
162+
.. _`TCP-keepalive`: https://redis.io/topics/clients#tcp-keepalive

0 commit comments

Comments
 (0)