0.9.0 • Published 2 years ago

cache-middleware-express v0.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

cache-middleware-express

A memory caching middleware for express.

Usage

const express = require('express');
const cache = require('cache-middleware-express');

const app = express();

// Cache single route for 30 seconds
app.get('/some/api/url', cache(30), (req, res) => ...)

// Cache single route for an hour
app.get('/some/api/url', cache(60*60), (req, res) => ...)