Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Redis Adapter Laravel Package

cache/redis-adapter

PSR-6 cache pool backed by Redis using the PhpRedis extension. Part of the PHP Cache ecosystem, with shared docs for advanced features like tagging and hierarchy. Supports Redis, RedisArray, and RedisCluster clients.

View on GitHub
Deep Wiki
Context7

Redis PSR-6 cache pool

Latest Stable Version Coverage Software License

This package provides a PSR-6 cache pool for Redis, RedisArray, and RedisCluster clients from PhpRedis.

Use the Predis adapter when your application uses Predis.

Installation

Install the package and enable the Redis extension:

composer require cache/redis-adapter:^3.0

Usage

use Cache\Adapter\Redis\RedisCachePool;

$client = new Redis();
$client->connect('127.0.0.1', 6379);
$pool = new RedisCachePool($client);

The pool also accepts RedisArray and RedisCluster clients:

$array = new RedisArray(['127.0.0.1:6379', '127.0.0.2:6379']);
$arrayPool = new RedisCachePool($array);

$cluster = new RedisCluster(null, [
    '127.0.0.1:7000',
    '127.0.0.1:7001',
    '127.0.0.1:7002',
]);
$clusterPool = new RedisCachePool($cluster);

Upgrading to version 3

Version 3 stores tag indexes as sorted sets under the reserved php-cache:tag: prefix. Each index expires with its longest-lived item and stays persistent while it contains a non-expiring item.

Each tagged item stores a generation snapshot. The sorted set stores the current generation marker with the item index.

After the last indexed item is removed, the generation marker remains for 60 seconds. This lets an immediate rewrite reuse the same generation before the new index member is added.

Version 2 uses Redis sets under tag! keys. Version 3 does not read those indexes.

Stop all workers, clear the Redis cache, and then deploy version 3. Follow the same sequence before a rollback.

RedisArray runs tag scripts on the current shard selected for each tag key. Its index, autorehash, and previous-ring fallbacks do not apply to tag indexes. Stop workers and clear the cache before changing the RedisArray ring.

Upgrading to version 2

Version 2 stores tag indexes as Redis sets. Older releases use Redis lists for the same keys.

Stop all workers, clear the Redis cache, and then deploy version 2. Follow the same sequence before a rollback.

Contributing

Send pull requests to the main repository. Report issues on the GitHub issue tracker.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core