Configuración de cache
This commit is contained in:
parent
adabf25eac
commit
5e3b476278
@ -7,6 +7,12 @@ module.exports = {
|
|||||||
dialect: 'mysql',
|
dialect: 'mysql',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cache: {
|
||||||
|
enabled: false,
|
||||||
|
defaultDuration: '1 minute',
|
||||||
|
debug: true,
|
||||||
|
},
|
||||||
|
|
||||||
session: {
|
session: {
|
||||||
secret_token: process.env.SECRET_TOKEN || "B57J=7B`NQ$y98|~5;hc715bo09^5oz8NR+]n9r~215B91Nd9P%25_N6r!GHcOKp|18y5-73Dr5^@9k7n]5l<-41D1o",
|
secret_token: process.env.SECRET_TOKEN || "B57J=7B`NQ$y98|~5;hc715bo09^5oz8NR+]n9r~215B91Nd9P%25_N6r!GHcOKp|18y5-73Dr5^@9k7n]5l<-41D1o",
|
||||||
token_expires_in: '365d'
|
token_expires_in: '365d'
|
||||||
|
|||||||
@ -15,6 +15,13 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cache: {
|
||||||
|
enabled: false,
|
||||||
|
defaultDuration: '1 minute',
|
||||||
|
debug: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
session: {
|
session: {
|
||||||
secret_token: process.env.SECRET_TOKEN || "B57J=7B`NQ$y98|~5;hc715bo09^5oz8NR+]n9r~215B91Nd9P%25_N6r!GHcOKp|18y5-73Dr5^@9k7n]5l<-41D1o",
|
secret_token: process.env.SECRET_TOKEN || "B57J=7B`NQ$y98|~5;hc715bo09^5oz8NR+]n9r~215B91Nd9P%25_N6r!GHcOKp|18y5-73Dr5^@9k7n]5l<-41D1o",
|
||||||
token_expires_in: '365d'
|
token_expires_in: '365d'
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
const apicache = require('apicache');
|
const apicache = require('apicache');
|
||||||
const redis = require('redis');
|
const redis = require('redis');
|
||||||
const NODE_ENV = process.env.NODE_ENV || 'development';
|
const config = require('../config');
|
||||||
|
|
||||||
|
|
||||||
const cacheWithRedis = apicache
|
const cacheWithRedis = apicache
|
||||||
.options({
|
.options({
|
||||||
debug: true,
|
debug: config.cache.debug,
|
||||||
defaultDuration: '1 minute',
|
defaultDuration: config.cache.defaultDuration,
|
||||||
enabled: NODE_ENV !== 'development',
|
enabled: config.cache.enabled,
|
||||||
//redisClient: redis.createClient(),
|
//redisClient: redis.createClient(),
|
||||||
//appendKey: (req, res) => req.user ? req.user.id : '',
|
//appendKey: (req, res) => req.user ? req.user.id : '',
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user