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?

Recached is an in-memory cache written in Rust that solves a problem no other cache tool addresses: the same engine runs natively on your server and as WebAssembly inside the browser, with both sides kept in sync over WebSockets.

On the backend, it speaks RESP on port 6379 — any Redis client works against it today without code changes. In the browser, you import it as a .wasm module and get zero-latency local reads with automatic background sync to the server.

typescript
import init, { RecachedCache } from 'recached-edge'

await init()
const cache = new RecachedCache()

// Connect to the server — mutations sync both ways automatically
cache.connect('ws://localhost:6380')

cache.set('user:theme', 'dark')
console.log(cache.get('user:theme')) // 'dark' — read from local WASM memory, 0 ms

// When your backend does SET user:theme light over RESP,
// this browser instance receives the update automatically.
cache.watch('user:theme', (newValue) => {
  document.body.dataset.theme = newValue ?? '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.