Support Forums

Looking for dynamic CDN caching based on different domains

I am evaluating Next.js and Netlify for my next project, please help me understand whether its possible to cache (on CDN) same relative URLS with different content for different domains?

I have a SAAS based web application, can I pre-render or do SSR and cache different HTML code/output for same pages based on different domain names?

For Example
MyApp home page /home is cached on Netlify CDN for DOMAIN abc.com, and I offered a White Labelled Reseller-ship to a client of mine who has some content changes in the same page /home but its gonna show those change when a visitor opens XYZ.com.
Via a config file in the JS code I can ensure the change/output, but I want this different content to be cached on CDN - so that SEO happens my domain as well as for my client domain - although the code repo and deployment is same. If multiple deployments are required then too its okay.

Is this possible … If yes please guide me with docs links/video links please…


I’ve previously achieved this “single codebase, multiple site output” by setting up multiple sites within Netlify all connected to the same repository.

For each Netlify site I would configure a build command flag or environment variable to let the build script know which specific version of the site to build.