▲ | chrismorgan 9 hours ago | ||||||||||||||||
> 1. Import React. This is the step you can do from a CDN instead of you want a faster initial page load. Using a CDN is very unlikely to get you a faster initial page load. Initialising an HTTPS connection to a new host is almost always going to take longer than serving that file first-party; there’s even a decent chance of this if your server is on the other side of the world. | |||||||||||||||||
▲ | kqr 9 hours ago | parent [-] | ||||||||||||||||
The problem in this case is not the HTTPS connection, but the fact that browsers, when importing ES6 modules, import all their transitive dependencies one by one. This means they can make a bazillion requests under the hood when importing just one library. A CDN is likely to have the library bundled and minified with its dependencies, turning those bazillion requests into a single one, which is much faster. | |||||||||||||||||
|