framework
Next.js
Compose Playstack server contracts, React bindings, SSR handoff, and route adapters at the Next.js application edge.
Use namespaced portable caches with typed serialization, tag invalidation, and explicit stampede-protection capabilities across Redis, Workers, and local runtimes.
Keep application and environment boundaries in every physical key while preserving direct access to the configured storage client.
Packages
Frameworks and integrations
Load a missing value once with process-local or distributed locking declared by the selected adapter.
Packages
Invalidate related keys through versioned tags without provider-specific key scans or hidden global state.
Packages
Frameworks and integrations
framework
Compose Playstack server contracts, React bindings, SSR handoff, and route adapters at the Next.js application edge.
framework
Connect portable Playstack capabilities to dependency injection, guards, decorators, request context, workers, and lifecycle hooks.
integration
Use Redis for distributed caches, rate-limit counters, and BullMQ-backed jobs while keeping application policy portable.
framework
Run portable contracts in Web-standard runtimes with explicit Workers KV, R2, Queues and Durable Object adapters.
integration
Use an application-supplied Workers KV binding for namespaced cache storage with explicitly eventual capabilities.
Every cache instance receives an application and environment identity. Physical keys therefore remain safe when multiple products, previews, workers, or test suites share one provider.
import { createCache } from '@playstack/cache'
import { RedisCacheStorage } from '@playstack/cache/redis'
export const cache = createCache({
app: 'billing',
environment: 'production',
driver: new RedisCacheStorage(redis),
lockTtlMs: 30_000,
})
const plan = await cache.remember(
'plans:pro',
60_000,
() => plans.load('pro'),
)const accountCache = cache.tags('accounts', `account:${account.id}`)
await accountCache.put('summary', summary, 60_000)
await accountCache.flush()Tag versions avoid provider key scans. An adapter declares whether invalidation is immediate or eventual and whether stampede protection is process-local or distributed, so an application can reject a capability mismatch during configuration.
Serialization, lock timeouts, and provider unavailability have distinct stable errors. The application decides whether a specific read may fail open, retry, or bypass the cache; the package does not silently turn an infrastructure failure into a miss.
The native Cache guide covers direct ioredis binding, bounded memory/Redis storage, native batches, remaining-TTL fills and combined logical statistics. Configure a finite L1 staleness ceiling; another process's overwrite can remain stale until that ceiling. This is not a coherent authorization or revocation store.
Opt-in background writes support immediate provisional reads through their own
helper, with separate memory/pending-work budgets and an explicit shutdown drain.
Admission is lossy, not a Redis acknowledgment. Unknown write failure stops the
helper and clears provisional values rather than automatically retrying an
uncertain write; ordinary cache writes and remember remain acknowledged.