0

i am trying to do a ssg for one of my pages with the fetch api that my api call

async function test() {
  const res = await fetch("https://som-url.com/myFunc", { cache: "force-cache" });
  const json = await res.json();
  return json;
}

now I am trying to build my project and I get the same results on each build although the data in the API is changing I am trying to cache the results at each build I mean that just when I am building the project it will make the API call and after that it will cached until the next build if you need more code I will add whatever is needed Thank you

  • You are not using the correct `cache` option for the output you are looking for. Check out the answer to the linked thread please :) – Youssouf Oumar May 15 '23 at 19:49

0 Answers0