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
@@ -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
~~~