An open API service indexing awesome lists of open source software.

https://github.com/sdesalas/cache-middleware-express

A caching middleware for express
https://github.com/sdesalas/cache-middleware-express

Last synced: about 2 months ago
JSON representation

A caching middleware for express

Awesome Lists containing this project

README

        

# cache-middleware-express

A memory caching middleware for express.

Usage
--------------

```javascript
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) => ...)

```