Store compact binary session blobs in a key-value cache.
Dynamic (stateless) — each value is encoded independently with encode and decoded with decode.
pnpm example:cache-payload100 user session objects stored in an in-memory Map<string, Uint8Array>, with total size compared against JSON strings. A roundtrip decode verifies data integrity.
- Redis, Memcached, or CDN edge caches
- Session stores with stable object shapes
- Config snapshots that are read more often than they change
Use stateless encoding per cache key. Stateful session compression is for ordered streams, not unrelated KV entries.