title: Doesn Next.js API route cache the query result?
body: <p>I've got a Next.js app that uses a third party API to show some data. I'm requesting this data with Next.js API routes. Here is my <code>/pages/api/data.js</code>.</p>
  <pre><code>const handler = async (req, res) =&gt; {
      const data = await fetch('https://api.example.com/v1/data');
  
      res.status(200).json(data);
  };
  
  export default handler;
  </code></pre>
  <p>How does it work behind the scenes? Does it fetch the third party API each time I send requests to <code>/api/data</code>? Or does it cache the results at build time?</p>