See also: https://prospectsoft.aha.io/ideas/ideas/SPA-I-146. Part 1 sets out to create a CDN manually.
Part 2: CDN's with automation
Once we have a working CDN (see part 1). The next step is to:
the CMS editor, both in editing and in previewing the content, will ALWAYS need to load domaincode.onprospectsoft.com rather than the customers primary domain - because otherwise we will always load from the CDN, and the CDN doesnt know anything about our preview mode.
for any customer going to domaincode.onprospectsoft.com you will get the site directly from us, going to the live (your custom) domain will get your site from the CDN (ans will always be the published version).
Probably the hardest bit of all of this is the documentation that explains setting up CNAMES to the customer
Note: we need to consider how to make this work in QA without registering a load of QA CDN domains? Mmaybe we only need a few to work in QA for testing purposes.