I’m following along with your CDN video (great job), and I want to confirm how to set up the CDN with an existing custom domain. In your video example, you’re using the backendless host names. My app has a custom domain -
Am I correct that I need to update the existing DNS cname for portal.meadowfarms.com to point to Fastly? It currently points to a backendless host. You discuss this at the 12:20 mark in the video.
I would appreciate a step-by-step to make sure I don’t mess this up because the TTLs on DNS make mistakes slow to correct.
Since your app is already in production, using the same domain name will result in some downtime. If that’s acceptable, then yes, you would need to point the subdomain to Fastly. You can find the step-by-step instructions in our docs:
Cache and CDN Integration - Backendless REST API Documentation
Alternatively, you can follow what I was doing in the video.
I can’t change the sub-domain we use; it is in all of our materials. The downtime will come from which step? Changing the DNS over shouldn’t result in any downtime as it will be moving from backendless to the CDN, both of which serve the app, right?
Is it changing the Backendless API from the current custom domain to the backendless host cause downtime?
- You will need to remove the current CNAME mapping for the subdomain. That change will start propagating through the DNS system.
- I assume immediately after (1) you will create a CNAME mapping for the same subdomain to point it to Fastly. That will also start immediate propagation through the DNS.
It is possible that some DNS servers will get the update for (1) and there will be some time before they get the update for (2). If a request reaches such a DNS server, it will not have a mapping to respond with and thus the request may fail.
Ah, yes. That makes sense.
At what point will in the process would you recommend I switch the Backendless API from the custom domain to the backendless host?
- Create your Fastly account
- Configure a Delivery service (add the domain name and the hostname) and launch the version.
- Create an SSL certificate (in the Secure section of their console)
- Once a cert is generated, you will get an instruction for configuring the domain in the DNS.
After step 4 is when you perform the switch.
If Fastly is caching the web files, and those files only change when the app is re-published (assuming app is built-in UI builder), why wouldn’t I set the caching time to something really long and just purge the cache any time a new update is published?
In your example, you used 60 seconds, but it seems like days would be appropriate.
Or am I missing something?
You can set the Max-Age to whatever makes sense in the context of your application. I was using 60 seconds strictly for demonstration purposes.
@mark-piller Thanks for the follow up. Sorry for the delayed reply on my end.
Would you be able to share some suggested max-age examples? I’m sure others would also benefit from context specific max-age suggestions.
@mark-piller Awesome! Thank you.