Skip to content

thinkgrid-labs/recached

Repository files navigation

Recached

Recached ⚡

A Rust cache server that runs on your backend and inside the browser.

Docs Rust Multi-Core Wasm MIT


Recached is an in-memory cache written in Rust that compiles to WebAssembly. The same cache engine runs natively on your server and directly inside the browser, with the two sides kept in sync over WebSockets.

On the backend it speaks RESP, so any Redis client works against it today. In the browser, you import it as a .wasm module and get zero-latency local reads with automatic background sync — no polling, no external state management library, no stale data.

Note

Recached is not a full Redis replacement. It covers the subset most applications actually need: strings, expiry, counters, all collection types, transactions, pub/sub, and observable keys. Best fit: reactive UIs, session caches, browser-side API response caching, and rate limiting.

→ Full documentation, use cases, API reference, and guides at recached.io


Install

# Docker
docker run -p 6379:6379 -p 6380:6380 ghcr.io/thinkgrid-labs/recached:latest

# Homebrew (macOS)
brew tap thinkgrid-labs/recached && brew install recached && recached-server

# Cargo
cargo install recached && recached-server
# Browser / Edge (npm)
npm install recached-edge

How it works

┌─────────────────┐        RESP (port 6379)        ┌──────────────────┐
│   Your backend  │ ──────────────────────────────► │  Recached Server │
└─────────────────┘                                 │  (server-native) │
                                                    └────────┬─────────┘
                                                             │ WebSocket
                                                             │ sync (6380)
                                                    ┌────────▼─────────┐
                                                    │  Browser / Edge  │
                                                    │  (wasm-edge)     │
                                                    │  local reads: 0ms│
                                                    └──────────────────┘

Any mutation on the server is pushed to all connected browser instances automatically. Any write from the browser is pushed to the server and fanned out to other clients. Reads always come from local WASM memory — no network hop.


Quick look

Backend — any Redis client, port 6379:

import Redis from 'ioredis';
const cache = new Redis('redis://127.0.0.1:6379');
await cache.set('inventory:item:99', '42');

Browser — WebAssembly, port 6380:

import { createCache } from 'recached-edge';

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

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

Contributing

  1. Benchmarksredis-benchmark against Redis 7 on multi-core hardware
  2. Client examples — React, Vue, or SvelteKit demos using recached-edge
  3. Bug reports — edge cases in the RESP parser, TTL eviction, pub/sub delivery, or WebSocket sync

Open a PR or file an issue. See recached.dev/roadmap for what's planned.

License

MIT — © 2026 ThinkGrid Labs

Sponsor this project

Packages

 
 
 

Contributors