Requires Node V6
const redis = require('redis');
const client = redis.createClient();
app.set('redis', client); // The middleware reads its Redis client from app
const supportedQuerystrings = {
key: true, // Accepts all values
complex: (value) => {} // Return a boolean
};
const cache = expressRedisCache.create(supportedQuerystrings);
app.use(cache);
const cache = expressRedisCache.create('blogPosts', supportedQuerystrings);
app.use('/blog', cache); // OR
app.use(cache);