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:
bitactive
2024-04-08 23:40:15 +02:00
committed by GitHub
parent 5f1eecfba6
commit da4ab0a72c
4 changed files with 126 additions and 13 deletions
+10
View File
@@ -118,6 +118,16 @@ redis.session.lock_wait_time = 50000
redis.session.lock_retries = 2000
~~~
### 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
~~~
## Running the unit tests
phpredis uses a small custom unit test suite for testing functionality of the various classes. To run tests, simply do the following: