Walkthrough / AB CDN Testing Javascript Hosting

Suppose I have one javascript file that I have been distributing to a large number of my clients, similar to GA * ga.js, and this file is downloaded quite a high number of times when I have to put it on a CDN.

The problem with this setting is that it is very difficult to β€œgenerate” a new version of javascript. Ideally, when I have a new version of JS, I would like to split the incoming traffic on a CDN and send 1% of all traffic to a new JS (randomly selected), or maybe send a new JS only for specific URLs.

I came across this problem several times and did not come up with a good solution. One possible solution is to work with CDN, although this is a lengthy process. An alternative solution is that clients always download a javascript loader that knows where the actual JS or phased JS is located, and accordingly breaks the traffic.

I am curious if there are any alternative solutions that people have come up with. This is a fairly common problem for any company that distributes its JS, such as Google, Twitter, Facebook, Linkedin, etc.

+6
source share
1 answer

Since most CDN services rely on you adding a new CNAME record to your domain to point to the CDN host name. You can use DNS to split traffic between different CDN services.

+1
source

Source: https://habr.com/ru/post/901076/


All Articles