2012-12-29, 09:42 AM
Advantages of external hosting:
- possibility that the script is already cached
- script may load faster, depending on the external server's bandwidth availability and geolocation (the reverse can be true as well)
- less bandwidth usage from your own server
Disadvantages:
- website is no longer self contained + cross domain scripting is a bit ugly
- reliance on a 3rd party for proper site functionality (eg servers could be down, blocked, or slow, or they simply just stop providing the CDN service (this can be somewhat mitigated with above suggestion)) + security (eg DNS hijacking of CDN)
- possibly could load slower due to requiring a 2nd DNS request
- privacy concerns
- less control over script contents
I believe that CDNs should NOT be used by default.
- possibility that the script is already cached
- script may load faster, depending on the external server's bandwidth availability and geolocation (the reverse can be true as well)
- less bandwidth usage from your own server
Disadvantages:
- website is no longer self contained + cross domain scripting is a bit ugly
- reliance on a 3rd party for proper site functionality (eg servers could be down, blocked, or slow, or they simply just stop providing the CDN service (this can be somewhat mitigated with above suggestion)) + security (eg DNS hijacking of CDN)
- possibly could load slower due to requiring a 2nd DNS request
- privacy concerns
- less control over script contents
I believe that CDNs should NOT be used by default.