Join the DZone community and get the full member experience.Join For Free
- Decreased latency: Chances are high that a CDN server is closer to a user than your own server. Thus: faster delivery.
- Better caching: If several sites use the same CDN, a copy of your library might already be cached in a user’s browser.
- Naturally, a reason against it is that it does not always work when you work offline, with file URLs. If that matters, you can dynamically load your libraries and switch to locally stored versions if the URL protocol is file.
- The post suggests to use protocol-relative URLs if you want you site to work both with HTTP and HTTPS. This breaks down if you are using file URLs to test your site (as the CDNs cannot be reached via that protocol).
Here are links to what is available:
Published at DZone with permission of Axel Rauschmayer , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.