How to support API level caching with sequelize #17244
Unanswered
kom24al
asked this question in
Help & Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
var SimpleCache = require('sequelize-simple-cache');
const getOrder = async (orderObj) => {
try {
var orderInfo = {};
var cachedData = false;
var cache = new SimpleCache(db.OrderInfo);
} catch (error) {
logger.error(error);
}
};
Cache object contains below structure:
SequelizeSimpleCache {
config: {
orderInfo: {
ttl: 3600,
methods: [Array],
methodsUpdate: [Array],
limit: 50,
clearOnUpdate: true
}
},
debug: false,
ops: 0,
delegate: [Function: delegate],
cache: {},
stats: { hit: 0, miss: 0, load: 0, purge: 0 }
}
How to set resultset into cache?
Beta Was this translation helpful? Give feedback.
All reactions