(edited)
When using Astro with Vercel and enabling ISR, I expect pages to:
- Revalidate after the configured
expirationtime. - Serve stale content during regeneration.
- Eventually return a fresh version.
However, in both tested configurations(below), the pages remain fully static and never revalidate, even after several minutes and repeated requests.
Config 1: (per Vercel docs)
// astro.config.mjsexport default defineConfig({ output: "server", adapter: vercel({ isr: { expiration: 60, }, }),});// src/pages/test-isr.astroexport const prerender = true;Config 2 (per legacy Astro docs)
// astro.config.mjsexport default defineConfig({ output: "server", adapter: vercel({ isr: true, }),});// src/pages/test-isr.astroexport const prerender = { expiration: 60 };In both cases, the page is cached once and never revalidates, even after 60+ seconds. Timestamps show no change across multiple repeated visits.
Steps to Reproduce
- Create an astro page:
---export const prerender = true;const now = new Date().toISOString();---<html> <body> <h1>ISR Test</h1> <p>Rendered at: {now}</p> </body></html>- Deploy to Vercel with the above
astro.config.mjsconfigs - Load the page
- Wait >60 seconds
- Refresh the page
Actual result:
- Page shows the same timestamp
x-vercel-cachealways reportsHIT- No
REVALIDATEDorSTALEbehavior observed
Would really appreciate help understanding if I missed something in the configs issue or a known limitation or a bug in the current ISR support for Astro on Vercel. Thanks!
Reference Docs