feat: store Redis cache payloads with the igbinary codec

utopia-php/cache 5.1.0 lets an adapter take a Codec. Pass Igbinary to the
Redis cache adapter so entries are stored as binary rather than JSON: on
a page of 50 documents that is about a quarter of the bytes and a 2.4x
faster load through Redis. Entries written as JSON by an older release
decode as misses and are repopulated, so no migration is needed.

Needs appwrite/base 2.1.0, which ships the igbinary extension.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
loks0nandClaude Fable 5.1 committed 2026-09-16 18:26:12 +01:00
1 parent ca3c55abfe
commit e1eb7582f0
4 files changed
+16 -12

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM appwrite/base:2.0.5 AS base
FROM appwrite/base:2.1.0 AS base
LABEL maintainer="team@appwrite.io"
@@ -119,7 +119,7 @@ EXPOSE 80
CMD [ "php", "app/http.php" ]
FROM appwrite/base:2.0.5-xdebug AS xdebug
FROM appwrite/base:2.1.0-xdebug AS xdebug
FROM base AS development
@@ -129,7 +129,7 @@ RUN printf 'opcache.validate_timestamps=1\nopcache.revalidate_freq=0\n' > /usr/l
COPY ./docs /usr/src/code/docs
COPY ./dev /usr/src/code/dev
# appwrite/base:2.0.5 ships without XDebug, so it cannot reach production or
# appwrite/base:2.1.0 ships without XDebug, so it cannot reach production or
# Cloud. The -xdebug tag is the same build with the extension; mounting it
# rather than copying keeps xdebug.so out of every layer unless DEBUG asked
# for it, and guarantees an ABI match because both tags are one base build.
+2 -1
View File
@@ -6,6 +6,7 @@ use Appwrite\Hooks\Hooks;
use Appwrite\PubSub\Adapter\Redis as PubSub;
use Appwrite\URL\URL as AppwriteURL;
use Utopia\Cache\Adapter\Redis as RedisCache;
use Utopia\Cache\Codec\Igbinary;
use Utopia\Config\Config;
use Utopia\Database\Adapter\MariaDB;
use Utopia\Database\Adapter\Mongo;
@@ -267,7 +268,7 @@ $register->set('pools', function () {
};
case 'cache':
$adapter = match ($dsn->getScheme()) {
'redis' => new RedisCache($resource()),
'redis' => new RedisCache($resource(), new Igbinary()),
default => null
};
+2 -1
View File
@@ -68,6 +68,7 @@
"ext-yaml": "*",
"ext-dom": "*",
"ext-redis": "*",
"ext-igbinary": "*",
"ext-swoole": "6.*",
"ext-pdo": "*",
"ext-openssl": "*",
@@ -79,7 +80,7 @@
"utopia-php/audit": "^4.0",
"utopia-php/auth": "^0.12",
"utopia-php/balancer": "0.4.*",
"utopia-php/cache": "^5.0.0",
"utopia-php/cache": "^5.1.0",
"utopia-php/cdn": "^0.0.11",
"utopia-php/cli": "^0.24",
"utopia-php/compression": "0.1.*",
Generated
+9 -7
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5667bfb5aaae8ea98f2edd4d33aa5927",
"content-hash": "1c490bf3e48c238620409ca6ec2dc175",
"packages": [
{
"name": "adhocore/jwt",
@@ -2984,16 +2984,16 @@
},
{
"name": "utopia-php/cache",
"version": "5.0.3",
"version": "5.1.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/cache.git",
"reference": "f808a39d018e1f325ac553b8de39798cae40c1f9"
"reference": "62d8ac01d725bfe07474cc4960775904b1a5101e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/f808a39d018e1f325ac553b8de39798cae40c1f9",
"reference": "f808a39d018e1f325ac553b8de39798cae40c1f9",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/62d8ac01d725bfe07474cc4960775904b1a5101e",
"reference": "62d8ac01d725bfe07474cc4960775904b1a5101e",
"shasum": ""
},
"require": {
@@ -3007,6 +3007,7 @@
"swoole/ide-helper": "^6.0"
},
"suggest": {
"ext-igbinary": "Required for the Igbinary codec.",
"ext-memcached": "Required for the Memcached and Hazelcast adapters.",
"ext-redis": "Required for the Redis, RedisCluster and Sharding adapters.",
"ext-swoole": "Required for the multiplexing Redis adapter (>=6.0)."
@@ -3037,9 +3038,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cache/issues",
"source": "https://github.com/utopia-php/cache/tree/5.0.3"
"source": "https://github.com/utopia-php/cache/tree/5.1.0"
},
"time": "2026-09-11T08:23:02+00:00"
"time": "2026-09-16T14:41:42+00:00"
},
{
"name": "utopia-php/cdn",
@@ -8356,6 +8357,7 @@
"ext-yaml": "*",
"ext-dom": "*",
"ext-redis": "*",
"ext-igbinary": "*",
"ext-swoole": "6.*",
"ext-pdo": "*",
"ext-openssl": "*",