We have launched new CDN - Here is how it will affect you

Hi Collectchatters,

Hope you are doing well :slight_smile:

In past few weeks, we have been working on a new Content delivery network( A web address where our scripts are loaded to your website) which will drastically speed up the loading of chatbot and improve your website speed. Many of you have already raised concerns about our script slowing down the site and not having GZIP compression for the javascript files.

Today we are launching the CDN for early adopters. Here are few reasons you should upgrade to the new CDN

  • Reliability
    We have faced outages in past due to our dependency on Amazon s3 servers (https://www.theregister.co.uk/2017/09/15/aws_brownout/). The new CDN will use Cloudflare servers on top of Amazon s3 that are distributed all over the world. In other words, there will be no single point of failure.
  • Closer to your user’s physical location
    Our old script files were hosted in AWS east region (N. Virginia, USA) and the new global CDN is distributed across the world. Now the script will be loaded from the location close to your user and it will reduce the loading time.
  • Compression
    The script and hence the chatbot will load blazingly fast. Thanks to the gzip and http2/spdy we have implemented, the size of our scripts have been reduced to almost 1/3rd of the previous version.
  • SEO impacts
    Few users have sent their concerns about google page insights(https://developers.google.com/speed/pagespeed/insights/) showing that Collect.chat scripts need optimization and were worried about Google. Now that our scripts are 100% gzipped you don’t need to worry about SEO penalties from Google algorithms.

Benchmark: Our initial scripts were of 312KB and now it’s below 80KB. That means on average chatbot takes 500ms to load instead of 1.9s.

How to migrate to new CDN

Note: New CDN will work even if you do not do the following steps. But we highly recommend you to do this.

You just need to change URL of our launcher https://s3.amazonaws.com/collectchat/launcher.js to new URL https://collectcdn.com/launcher.js. It’s only a matter of replacing the text.

Given below is the old script with the AWS URL to the script:

<script type="text/javascript">!function(t,e){"use strict";var r=function(t){try{var r=e.head||e.getElementsByTagName("head")[0],a=e.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",t),r.appendChild(a)}catch(t){}};t.CollectId = "XXXX",r("https://s3.amazonaws.com/collectchat/launcher.js")}(window,document);</script>

and the new script with the updated URL is:

<script type="text/javascript">!function(t,e){"use strict";var r=function(t){try{var r=e.head||e.getElementsByTagName("head")[0],a=e.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",t),r.appendChild(a)}catch(t){}};t.CollectId = "XXXX",r("https://collectcdn.com/launcher.js")}(window,document);</script>

Note that XXXX points to your bot id in your script.

If you need assistance with anything or have any questions feel free to reply here. You can also reach us via writing to care@collect.chat or tweeting at @collectchat

Cheers,
Shyjal

4 Likes