Skip to content

Commit

Permalink
unify javascript content delivery networks
Browse files Browse the repository at this point in the history
currently there are 4 CDNs that are being called for different
javascript libraries. this means that there are 4 different
third-party requests being made on each load.

why do it?
the advantage of unifying all of the libraries from a single
provider is that all of the requests can be served off a
single connection if the connection is made over HTTP/2
essentially making the load times at least 2 times faster.

why jsDelivr?
jsDelivr has a wide network spanning [multiple caching
network providers](https://www.jsdelivr.com/network) whereas
the other providers rely on a single caching network ( unpkg,
cdnjs - cloudflare, github - fastly ). while technically all
the requests could probably be served from the same backend
cache, since the requests are being proxied via different
domains, naturally, they have to go through different
connections. if all the requests are proxied through the same
domain and via HTTP/2, the requests can all be served via the
same connection making the page load faster.

other changes
- synced the library version for `ace/ext-language_tools` with
the loaded `ace.js` library

room for improvement
- `react` and `babel-polyfill` libraries could be upgraded to the
latest major versions. since I wasn't sure whether this would
cause any breakage in the application, I didn't attempt an
upgrade. I just used the already existing version but just
changed the provider URL. Maybe a minor version upgrade
( react ) would do much harm? ( I didn't want to take the risk
since it was react )
  • Loading branch information
shinenelson committed Jun 5, 2020
1 parent 2b7ebec commit a93884a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<title>No-install TDD environment</title>
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script src="//unpkg.com/[email protected]/dist/xdomain.min.js" slave="${KATAS_SERVICE_URL}/proxy.html"></script>
<script type="text/javascript" src="//ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/ace/1.1.9/min/ext-language_tools.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-with-addons.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/xdomain.min.js" slave="${KATAS_SERVICE_URL}/proxy.html"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/ace/1.2.6/min/ace.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/ace/1.2.6/min/ext-language_tools.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/react/15.5.4/react-with-addons.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/babel-polyfill@6.26.0/polyfill.min.js"></script>
<link type="text/css" href="style.css" rel="stylesheet"/>
</head>
<body>
Expand Down

0 comments on commit a93884a

Please sign in to comment.