#Does astro support Incremental Static Regeneration on cloudflare?
1 messages · Page 1 of 1 (latest)
Hi @stiff jasper. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Does astro support Incremental Static Regeneration on cloudflare?
Yes, Astro supports Incremental Static Regeneration (ISR) on Cloudflare, but it's called "on-demand rendering" in Astro terminology. This feature is available when using the @astrojs/cloudflare adapter.
According to the Astro documentation on Cloudflare deployment, you can build an Astro SSR site for deployment to Cloudflare Pages using the @astrojs/cloudflare adapter. This adapter enables on-demand rendering, which is similar to Incremental Static Regeneration in Next.js.
To set this up, you need to:
- Install the Cloudflare adapter:
npx astro add cloudflare
- Update your
astro.config.mjsfile to use the adapter and set the output mode to 'server':
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
export default defineConfig({
output: 'server',
adapter: cloudflare()
});
By configuring your Astro project this way, you can take advantage of on-demand rendering on Cloudflare, which is functionally similar to Incremental Static Regeneration in Next.js.