[等级英语=非常糟糕(来自法国......)]
我有一个带有node.js和epress.js的简单应用程序
此应用使用de模块“igdb-api-node”连接igdb api(https://www.igdb.com/api)
我使用此代码获取游戏whith关键字:
exports.findGameByKeyWord = function(req, res) {
return client.games({
fields: '*',
limit: 20,
offset: 0,
search: req.params.text
}).then(igdbResponse => {
res.send(igdbResponse.body);
});
};
所有这些工作都很棒,但现在我想将请求的结果存储在缓存中。
我想制作这个以加快结果的返回。
我一直在观看不同的想法,但这对我来说有点复杂,我想要一个例子来理解。
这里,我探索过的曲目:
https://github.com/BryanDonovan/node-cache-manager
https://www.npmjs.com/package/route-cache
https://github.com/kwhitley/apicache