“I want to enhance the performance of my tenants. Can you suggest a CDN?”
A CDN like Cloudflare works by functioning as a middle-man. For example, some domains (your customer’s domain) will point to CloudFlare, and CloudFlare will know where to look for the site (WPCS, in this case). CloudFlare then retrieves the website from the origin and distributes it via its global network.
It’s generally said that Cloudflare provides lightning-fast DNS resolution, so you likely will see speed improvements by onboarding your domain to Cloudflare.
Cloudflare does more than offer a CDN, by the way. Cloudflare is a global network designed to make everything you connect to the Internet secure, private, fast, and reliable.
In combination with WPCS, CloudFlare should act as a CDN for each tenant separately. We recommend manually setting up CloudFlare for one tenant to see how this process works.
Doing that, you’ll learn most of the steps required to automate. One step that is special for WPCS is described here: https://docs.wpcs.io/docs/tenants/cloudflare.
Setup DNS properly #
The most important step you’ll take is to set up the DNS properly. You’ll find that the CloudFlare API will make it relatively easy to set up new domains. Those domains can be pointed to WPCS quite easily as well. The trick will be to ensure your clients’ custom domains are pointing to CloudFlare correctly.
Practically, your customers must somehow point their websites to CloudFlare. This will likely mean that you must inform your customers what they should do with their domains and what exact A records they should add.
The process could be something like this:
- A customer buys a tenant and specifies a domain.
- You call the WPCS API and instruct it to provision a tenant under the specified domain.
- WPCS will provision the tenant and wait until the tenant can be reached under the specified domain to make it the main domain, AKA, after domain verification.
- You call the CloudFlare API and instruct it to create a new domain.
- After the tenant at WPCS is done provisioning, you instruct your new customer to set up their DNS in a specific way, namely, to point it to CloudFlare. You probably got some A records in the API call.
- After your customer has configured their DNS correctly (and the changes have propagated), CloudFlare will start getting website data from WPCS and serving it via the domain in question.
If you have questions based on this post, please contact us via the chat in the WPCS console.
You can start a free trial and experience the benefits of multi-tenant WordPress at WPCS.io.