@express-route-cache/memcached
v0.1.3
Published
Memcached adapter for @express-route-cache/core
Downloads
255
Maintainers
Readme
@express-route-cache/memcached
Memcached adapter for
@express-route-cache/core.
Installation
npm install @express-route-cache/memcached memjsUsage
import { createCache } from "@express-route-cache/core";
import { createMemcachedAdapter } from "@express-route-cache/memcached";
const cache = createCache({
adapter: createMemcachedAdapter({
servers: "localhost:11211",
// OR pass memjs options
options: {
retries: 2,
},
}),
staleTime: 60,
});Features
- Atomic Increments: Uses Memcached
incrfor O(1) invalidation. - Lightweight: Optimized for simple, high-throughput key-value storage.
- Binary Friendly: Correctly handles serialized response buffers.
- Safe Lifecycle Management: If you pass an existing
clientinstance, the adapter will never call.close()on it when tearing down, ensuring it won't kill connections shared by the rest of your app.
Documentation
For full configuration options and caching logic, see the Core Documentation.
License
MIT
