b1rdex/predis-compressible
A Predis plugin that transparently compresses Redis values, helping reduce memory usage and network payload sizes without changing your application code. It integrates with Predis connections and handles compression/decompression automatically.
set/mset/get/getMultiple. This package is that work, already done, with a command-level test surface. For most teams the in-house version is 200 lines of code plus a permanent tail of edge cases — the mset bug fixed in 1.1 is exactly the kind of edge case you would ship and not notice for months.Consider adoption when all of the following hold:
igbinary/lzf/zstd options already exist at the extension level.redis-cli reads, BI exports.SORT, no ZSET member tricks, no RedisJSON/RediSearch indexing over the payload. Compression makes the value a blob to the server.Look elsewhere when:
zstd + a versioned envelope) belongs in your own thin layer, not in a PHP-only decorator.config/redis.php to be the whole story, budget an integration task or pick a Laravel-first alternative.For executives — one paragraph: We are evaluating a small, narrowly scoped add-on to our Redis client that compresses values before they leave the application. The business case is memory cost: Redis pricing is dominated by RAM, and compression typically cuts stored bytes materially for session and cache payloads. It is a one-line integration, not a platform migration, and the risk is bounded because it only touches how bytes are written and read by our own code. The honest caveats are that it trades a little CPU for that memory saving, that the data it writes is only readable by services using the same wrapper, and that it is maintained by a single author — so we would pin the version and treat upgrades as reviewable diffs. Recommendation: pilot it on one non-critical cache and measure bytes-saved against latency before committing.
For engineering — the short version: predis-compressible registers a Predis profile that transparently compresses values on write and decompresses on read, so application code keeps calling set/get/mset unchanged. Version 1.1 is a maintenance release: it adds GitHub Actions CI (closing the biggest gap in 1.0 — no automated verification) and fixes mset, where multi-key writes were not being compressed per-value, producing inconsistent data that would fail on read or silently bypass the memory saving. No new APIs, no breaking changes, no deprecations. Integration is manual — construct your Predis client with the compressible profile; there is no Laravel service provider or config hook. Before adopting: confirm we are on Predis, confirm payload sizes justify it, and audit that no Lua, SORT, or module queries read the affected values server-side. Pin to 1.1 and add a smoke test that round-trips set, mset, and getMultiple through a real Redis instance.
How can I help you explore Laravel packages today?