4 ms·
Libraries on CDNs have drawbacks as well, like the additional dns-roundtrip. I think what's needed is a heuristic webpack-loader, where you can specify both a
by cel1ne 11y ago
Libraries on CDNs have drawbacks as well, like the additional dns-roundtrip.
I think what's needed is a heuristic webpack-loader, where you can specify both a self-hosted URL and a cdn-URL. It could work like this:
* Load the CDN version and fallback back to the self-hosted version, if it doesn't exist or takes too long.
* In certain cases (probability, origin of request, etc.) load the self-hosted version first, but load the CDN in the background, so it get's cached.