expressjs-redis-cache

0.0.7 • Public • Published

ExpressJS Redis Cache v0.0.7

Simple application level cache middleware using Redis as the cache store.

How do I get set up?

Installation is simple:

npm install expressjs-redis-cache

Usage

redisCache = require('express-redis-cache')
...
// insert before app.router middleware
app.use(redisCache.createCache(options));
app.use(app.router)

Options All of the options are optional and have appropriate defaults

  • client (default: null)
    • provide an already connected redis client
  • redisConnString (default: localhost)
    • Connection String for the Redis Instance if client isn't provided
  • cacheDuration (default: 60*5)
    • How long Responses are cached for
  • cacheControl (default: "public")
    • Sets the Cache-Control HTTP Header
  • cacheExceptions (default: [])
    • Array of routes which should be excluded from the cache. E.g. ['/admin/*', '/private']

Dependents (0)

Package Sidebar

Install

npm i expressjs-redis-cache

Weekly Downloads

2

Version

0.0.7

License

ISC

Last publish

Collaborators

  • justcompile