Alex Lindgren in Technology 3 minute read

Web Page Performance Tip: minimize CDNs used for external resources to minimize DNS lookups

Minor front-end dev performance tip: when loading external resources from CDNs, try to limit the number of CDNs. For example, instead of loading the following two resources:

Load just from CloudFlare:

This is good because it will reduce the number of DNS requests the browser will make thus shaving off a few milliseconds. In one test I made, the DNS look up tool 97ms:

In general, I opt for CloudFlare CDN because it’s one of the most popular (which means it is more likely to be cached in a client’s browser) and has a ton of libraries. Also, I've heard that Google, which also offers CDN hosting for popular libraries, is blocked in China.