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
- Host: GitHub
- URL: https://github.com/sdesalas/cache-middleware-express
- Owner: sdesalas
- License: mit
- Created: 2022-05-08T00:17:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-08T00:36:47.000Z (about 3 years ago)
- Last Synced: 2024-10-20T07:31:48.721Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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) => ...)```