Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eugenioclrc/memcached-middleware
https://github.com/eugenioclrc/memcached-middleware
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eugenioclrc/memcached-middleware
- Owner: eugenioclrc
- Created: 2018-12-02T13:39:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T08:15:12.000Z (about 2 years ago)
- Last Synced: 2024-10-27T23:39:30.130Z (about 2 months ago)
- Language: JavaScript
- Size: 144 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# memcache-middleware
## Uso
```javascript
const express = require('express');
const memcacheMiddlewareConstructor = require('./');const memcacheMiddleware = memcacheMiddlewareConstructor('localhost:11211')
const app = express();
app.use(memcacheMiddleware);app.get('/', function (req, res) {
res.locals.CACHE = {
duration: 3600 // la duracion va en segundos
};
res.send('esto sera cacheado');
});app.get('/otro', function (req, res) {
res.locals.CACHE = {
key: 'guardarconestakey',
duration: 3600 // la duracion va en segundos
};
res.send('esto sera cacheado en guardarconestakey');
});app.listen('9100');
```