Configuración de cache
This commit is contained in:
parent
adabf25eac
commit
5e3b476278
@ -7,6 +7,12 @@ module.exports = {
|
||||
dialect: 'mysql',
|
||||
},
|
||||
|
||||
cache: {
|
||||
enabled: false,
|
||||
defaultDuration: '1 minute',
|
||||
debug: true,
|
||||
},
|
||||
|
||||
session: {
|
||||
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'
|
||||
|
||||
@ -15,6 +15,13 @@ module.exports = {
|
||||
*/
|
||||
},
|
||||
|
||||
cache: {
|
||||
enabled: false,
|
||||
defaultDuration: '1 minute',
|
||||
debug: true,
|
||||
},
|
||||
|
||||
|
||||
session: {
|
||||
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'
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
const apicache = require('apicache');
|
||||
const redis = require('redis');
|
||||
const NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
const config = require('../config');
|
||||
|
||||
|
||||
const cacheWithRedis = apicache
|
||||
.options({
|
||||
debug: true,
|
||||
defaultDuration: '1 minute',
|
||||
enabled: NODE_ENV !== 'development',
|
||||
debug: config.cache.debug,
|
||||
defaultDuration: config.cache.defaultDuration,
|
||||
enabled: config.cache.enabled,
|
||||
//redisClient: redis.createClient(),
|
||||
//appendKey: (req, res) => req.user ? req.user.id : '',
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user