Next.js Discord

Discord Forum

Deploy a large NextJS ISR site without invalidating cache

Unanswered
Japanese common catfish posted this in #help-forum
Open in Discord
Japanese common catfishOP
I have a large NextJS headless application with more than 20k posts (and growing). The posts are ISR rendered with a revalidation interval of 10 sec. Due to the number of posts, it is not practical to pre-render them all on deploy. Currently, on deploy, my cache gets fully purged. My question is whether it is a choice by my hosting provider (who also provides my edge) to fully purge the cache on deploy? Are there alternatives, perhaps specific hosting providers with a different edge strategy, that would allow me to deploy, but that would keep the cache in place and only regenerate the posts during the ongoing ISR 10 sec revalidate interval?

4 Replies

British Shorthair
@Japanese common catfish Did you figure this out? Having similar issue.
Japanese common catfishOP
Not yet.
I am considering crawling the site as a webhook on deploy.
British Shorthair
Roger. Thanks for sharing.