Skip to content

Memcached Adapter

The Memcached adapter is ideal for high-performance key-value caching where complex data structures are not required.

Installation

bash
npm install @express-route-cache/memcached memjs

Setup

ts
import { createCache } from "@express-route-cache/core";
import { createMemcachedAdapter } from "@express-route-cache/memcached";

const adapter = createMemcachedAdapter({ servers: "localhost:11211" });

const cache = createCache({ adapter });

Options

OptionTypeDescription
serversstringMemcached server address (e.g., localhost:11211).
keyPrefixstringPrefix for all cache keys (default: erc:).

Performance

Memcached is known for its extreme speed and simplicity. This adapter is a great alternative to Redis for pure caching workloads.

Released under the MIT License.