Skip to main content
🔥
Guides

Cache Adapters Overview | @express-route-cache

Compare Memory, Redis (ioredis), and Memcached (memjs) cache adapters for Express.js. Choose the right storage backend for your production environment.

Adapters

@express-route-cache is adapter-agnostic. You can swap storage engines depending on your production environment.

Available Adapters

AdapterBest ForRequirement
MemoryLocal dev / Single-instanceNone (Built-in)
RedisProduction / Distributedioredis
MemcachedProduction / Distributedmemjs

Which one should I choose?

  • Use Memory if you are running a single Node.js process and don't need the cache to persist between restarts.
  • Use Redis (Recommended) for most production apps. it allows multiple server instances to share the same cache and is extremely fast.
  • Use Memcached if your infrastructure already uses it or if you only need simple key-value caching without complex data structures.

Creating a Custom Adapter

You can build your own adapter by implementing the CacheClient interface. See the API Reference for the full method signatures and requirements.