Hey,
Let’s say I’d want to use the fetch some data from a random api. How could I cache the response so if there’s a fresh response it wouldn’t fetch it again. I’ve been testing for some time on a test website but it doesn’t seem like it’s working. I’ve been searching through various sites but couldn’t find a response that I need.
const fetch = require("node-fetch");
async function getData() {
const api = '-';
const response = await fetch(api);
const data = await response.json();
return data;
}
(async () => {
let requiredData = await getData();
})()
Could I get a link to a page explaining this in-depth?