mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
Add compression support for PHP Sessions (#2473)
* Add compression support for PHP Sessions Previously, compression was available for standard data but not for session handling. This update enables the compression of PHP sessions, allowing for more efficient Redis memory usage. * Move session compress/uncompress logic to helper functions * Change session_compress_data to always set the out arguments and adjust PS_READ_FUNC
This commit is contained in:
+10
@@ -206,3 +206,13 @@ To enable, set the following INI variable:
|
||||
redis.session.early_refresh = 1
|
||||
```
|
||||
Note: This is disabled by default since it may significantly reduce the session lifetime for long-running scripts. Redis server version 6.2+ required.
|
||||
|
||||
### Session compression
|
||||
|
||||
Following INI variables can be used to configure session compression:
|
||||
~~~
|
||||
; Should session compression be enabled? Possible values are zstd, lzf, lz4, none. Defaults to: none
|
||||
redis.session.compression = zstd
|
||||
; What compression level should be used? Compression level depends on used library. For most deployments range 1-9 should be fine. Defaults to: 3
|
||||
redis.session.compression_level = 3
|
||||
~~~
|
||||
Reference in New Issue
Block a user