Skip to content

[Cache] add Redis options compression and tcp_keepalive #9985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions components/cache/adapters/redis_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ array of ``key => value`` pairs representing option names and their respective v

// associative array of configuration options
array(
'compression' => true,
'lazy' => false,
'persistent' => 0,
'persistent_id' => null,
'tcp_keepalive' => 0,
'timeout' => 30,
'read_timeout' => 0,
'retry_interval' => 0,
Expand All @@ -114,6 +116,10 @@ Available Options
If none is specified, it will return ``\Redis`` if the ``redis`` extension is
available, and ``\Predis\Client`` otherwise.

``compression`` (type: ``bool``, default: ``true``)
Enables or disables compression of items. This requires phpredis v4 or higher with
LZF support enabled.

``lazy`` (type: ``bool``, default: ``false``)
Enables or disables lazy connections to the backend. It's ``false`` by
default when using this as a stand-alone component and ``true`` by default
Expand All @@ -134,6 +140,10 @@ Available Options
Specifies the delay (in milliseconds) between reconnection attempts in case the client
loses connection with the server.

``tcp_keepalive`` (type: ``int``, default: ``0``)
Specifies the TCP-keepalive timeout (in seconds) of the connection. This requires
phpredis v4 or higher and a TCP-keepalive enabled server.

``timeout`` (type: ``int``, default: ``30``)
Specifies the time (in seconds) used to connect to a Redis server before the
connection attempt times out.
Expand All @@ -149,3 +159,4 @@ Available Options
.. _`RedisCluster`: https://github.com/phpredis/phpredis/blob/master/cluster.markdown#readme
.. _`Predis`: https://packagist.org/packages/predis/predis
.. _`Predis Connection Parameters`: https://github.com/nrk/predis/wiki/Connection-Parameters#list-of-connection-parameters
.. _`TCP-keepalive`: https://redis.io/topics/clients#tcp-keepalive