What are the pros and cons of using Google?
Pros
- Fast, geographically distributed, reliable CDN
- Free, saves using your bandwidth
- If many people use the Google version of jQuery (and they do), it is highly likely the user will have it in their browser cache, given the long expiry times Google sets when they serve the file (although there are some caveats). This means the user probably won't have to request the file at all. Even if users regularly clear their browser cache it is likely to be cached by a proxy.
Cons
- The CDN might be down, or slow, which will impact your site.
- If there is no Internet connection it won't work (definitely not the best choice for internal webservers)
- If you already have other javascript bundled into a minimised file (common practice), it is an extra web request that needs to be made, when you could just include it in the bundle.
- You are giving Google information about your customers (i.e. forcing them to make a request) to Google. Given the large amount of caching, this will not be comprehensive, and there is a reasonable chance you are running Google analytics anyway.
No comments:
Post a Comment