I’ve built a javascript file that my clients will be installing on their website which will call my server. I’m wondering if it would be better to host the javascript file on a CDN, instead of on my server? The benefits would be better response time and a much higher chance that it will always be available. However, In the future, if the CDN was bought by another company or went out of business the file may no longer be accessible and I would have a number of clients linking to a file that doesn’t exist. Is there any way to prevent this from happening?
Share
To Reference a content from CDN, you can either point your domain / subdomain to CDN servers and clients can reference the JS using your domain. So in future if you would like to switch the CDN, its just DNS entry away.
If you are not intrested in buying up space in a CDN, then you should suggest your clients to host it in a domain / subdomain which they own and update the DNS records to point to the CDN of their choice.