Middleware custom domain purge cache

Hello guys,

we have a NextJS 14 App with Sanity v3 as CMS. It’s similar to a website builder and we use the Middleware to show the site on custom domains. Sadly the revalidate method only works with the specific path (https://websitebuilder.com/site/website1.com) and not with the custom domain (https://website1.com). So when we update content for a specific site on Sanity it doesn’t render fresh data on the custom domain. Is there a way to purge/delete the cache for a single specific domain (like https://website1.com) ?

Thanks in advance :pray:

Have a nice day

Hi, @expconnor! Welcome to the Vercel Community.

Thanks for your patience! :smile:

Have you checked out our Sanity template? It might be helpful to compare set-ups. As far as I know, this uses a custom revalidation strategy using Next.js’s on-demand Incremental Static Regeneration (ISR) feature.

It would help to understand your middleware and routing set up. If you could either share your project or provide a minimal reproducible example, that would be super helpful.

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