I have a api export with a lot of data so I tried to used the node-cache so the api will be faster since take more than 2 min to get the data, I am new on this so I found the follow code: Notes: env node js/express
const NodeCache = require("node-cache"); const axios = require('axios'); const myCache = new NodeCache({stdTTL:100000}) axios.get('http://localhost:5000/test/example) .then(function (response) { console.log(response) myCache.set("exampleCache",response,10000); res.send(response)
Any suggestion or recommend will be great!
Advertisement
Answer
The solution was using a buffer but since we had to many data, the increase the memory from the db was the solution