Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Caching an entire API route for 5 minutes - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
3y ago
•
2 replies
sean
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
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
export const revalidate = 60
in my API route
.
Thank you in advance to anyone who
's willing to help
! Cheers
.
Data Fetching: Revalidating
Learn about revalidating data in Next
.js using Incremental Static Regeneration
.
Theo's Typesafe Cult
Join
26,131
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
API route call from another API route
TTC
Theo's Typesafe Cult / questions
3y ago
Disable route caching on page navigation
TTC
Theo's Typesafe Cult / questions
3y ago
caching data from external api
TTC
Theo's Typesafe Cult / questions
3y ago
Can't resolve 'fs' but in an API route???
TTC
Theo's Typesafe Cult / questions
3y ago