Caching requests made through Vercel when used as a reverse proxy

We have a Next.js website hosted on Vercel, and using rewrites, we fall back to internal servers for the pages we haven’t migrated yet.

If we needed to temporarily take down our servers - could we use vercel to serve up a cached response of all requests made through it - or even better - caching just the requests that fallback to those rewrites and not affect the Next.js part of the site?

Hi @josephcurley!

Yes, Vercel provides several features that can help you serve cached responses when your internal servers are down. You can use a combination of Edge Caching, Edge Config, and Middleware to achieve this.

For your setup with rewrites, you might find this guide helpful as a starting point:

Additionally, you could explore using Vercel’s Edge Caching to cache responses from your internal servers:

Let us know how you get on!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.