kinetis/cache-redis

PSR-16 SimpleCache for Kinetis, backed by Redis (single-node or Cluster) via amphp/redis — non-blocking, Revolt-native, with TLS support.

Maintainers

Package info

github.com/kinetis-dev/cache-redis

pkg:composer/kinetis/cache-redis

Transparency log

Statistics

Installs: 25

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.3 2026-08-16 08:56 UTC

This package is auto-updated.

Last update: 2026-08-16 08:57:29 UTC


README

Kinetis

kinetis/cache-redis
Redis-backed PSR-16 SimpleCache for Kinetis

Packagist Version Packagist Downloads PHP Version License CI

Psr\SimpleCache\CacheInterface, backed by Amp\Redis\RedisClient — non-blocking, Revolt-native, single-node or Cluster, with TLS support. This is the concrete Redis implementation Kinetis\SimpleCache (in kinetis/framework itself) leaves as an optional add-on: NullSimpleCache ships in core so the interface always has something bound, and this package supplies the real thing once you actually want it.

use Kinetis\SimpleCache\RedisSimpleCache;

$cache = RedisSimpleCache::fromConfig($config); // REDIS_URL or REDIS_HOST
$cache->set('key', 'value', ttl: 60);

Kinetis\Container\AppScope::boot() picks this up automatically once installed — REDIS_CLUSTER=true + REDIS_CLUSTER_SEEDS binds ClusteredRedisSimpleCache, REDIS_URL/REDIS_HOST alone binds RedisSimpleCache, neither binds NullSimpleCache — with zero application code required either way. Configuring Redis (REDIS_HOST/ REDIS_CLUSTER) without this package installed is a clear, immediate error naming the package to install, not a silent fallback to NullSimpleCache.

Configuration

Read from the environment (or .env) via Kinetis\Config. Every key is scoped. With none of REDIS_URL/REDIS_HOST/REDIS_CLUSTER set, Redis is simply off and CacheInterface binds to NullSimpleCache.

Key Default Purpose
REDIS_URL Full redis:// URI; wins over the discrete keys.
REDIS_HOST Server host.
REDIS_PORT 6379 Port.
REDIS_PASSWORD Password.
REDIS_DATABASE 0 Database index (single-node only; Cluster has no SELECT).
REDIS_TIMEOUT 5 Connect timeout, seconds.
REDIS_TLS false Connect over TLS.
REDIS_TLS_VERIFY_PEER true Verify the server certificate.
REDIS_TLS_CA_FILE CA certificate for verification.
REDIS_CLUSTER false Use Redis Cluster mode.
REDIS_CLUSTER_SEEDS Comma-separated seed nodes for Cluster bootstrap.

Scoped keys follow the named-connection convention — the connection name inserts after the first segment: REDIS_HOST + cache2REDIS_CACHE2_HOST. Full reference across every package: docs.kinetis.dev/config.html.

Installation

composer require kinetis/cache-redis

Requires PHP 8.4+ and kinetis/framework. Full documentation: docs.kinetis.dev/caching.html and docs.kinetis.dev/persistence.html (the Redis Cluster/TLS section).

License

MIT — see LICENSE.