Caching an entire API route for 5 minutes

Hi everyone! I was wondering if my Next.js API route (using the app directory) can be cached using Vercel as a server-side layer.
So, for example, if my api route returns something like:
createdAt: new Date

I would like to see the same date for 5 minutes.

As of right now I tried following this: https://nextjs.org/docs/app/building-your-application/data-fetching/revalidating#on-demand-revalidation

Which does seem to be working if I'm using fetch, but it doesn't if I put export const revalidate = 60 in my API route.

Thank you in advance to anyone who's willing to help! Cheers.
Learn about revalidating data in Next.js using Incremental Static Regeneration.
Was this page helpful?