Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Learn how to use file system cache to share responses across calls.
Reusing responses at build time is a Next.js example from Vercel that demonstrates how to share responses across calls using the file system cache, letting developers reduce redundant work during builds and at runtime.
This example is a ready-to-run Next.js application provided by Vercel as part of their curated examples collection. It takes no special configuration and immediately shows how to use the file system as a cache layer: the first call writes a response to disk, and subsequent calls read from that cached file instead of recomputing. The project includes a live demo at solutions-reuse-responses.vercel.app and a one-click deploy button that clones the repository directly into a new Vercel project.
pnpm create next-app --example pointing at the GitHub repository.The example uses the file system as a memoization layer. When a call is made, it checks whether a cached response already exists on disk; if it does, that response is returned, otherwise the response is generated and then written to the cache for future reuse.
