Skip to content

Recached ⚡Cache that runs everywhere.

Redis-compatible on your server. WebAssembly in the browser. Zero-latency reads. Automatic sync.

Recached

What is Recached?

Every caching solution forces a choice: server-side caches like Redis mean every frontend read is a network round-trip; client-side state like Zustand or SWR means two caches — one on the server and one in every client, with manual staleness code gluing them together. Recached removes the choice.

The same Rust cache engine runs natively on your server (RESP on port 6379 — any Redis client works today, zero code changes) and as WebAssembly inside the browser. Reads always come from local WASM memory. The WebSocket is only a sync path, not a read path.

typescript
import { createCache } from 'recached-edge'

const cache = await createCache({
  persistence: true,                          // survives page refresh via IndexedDB
  connect: { url: 'ws://localhost:6380' },    // syncs with the server
})

cache.get('inventory:item:99') // "42" — from local WASM memory, 0 ms

// React to any store mutation — local writes, server push, or cross-tab sync
cache.onMutation(() => {
  document.body.dataset.theme = cache.get('user:theme') ?? 'light'
})

No polling. No extra state management library. No round-trips for reads. The server is your backend's cache; the WASM module is your frontend's cache; the WebSocket is the invisible sync layer between them.

Released under the MIT License.