Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Olivia Wesnidge
Olivia Wesnidge
3,733 Points

Why don't browsers include libraries such as jQuery in local storage?

Why don't browsers include libraries such as jQuery in local storage (i.e. with installation of browser) so that whenever a website tries to load said files the browser will recognize it and just use the local storage copy saving in network traffic and loading time?

1 Answer

Steven Parker
Steven Parker
229,732 Points

One reason that springs to mind right off is that the libraries tend to be updated more often than the browsers, and not everyone updates their browser the moment a new one is available.

Another reason is that a particular site might only work with a particular library version (perhaps not the most current), but they supply the library from their own site and can insure compatibility that way.


On the other hand, a lot of sites deliberately do not store the library but load it from a common CDN resource (like Google). Chances are you've recently visited another site that does the same thing, so the library is already on your machine (in the cache area), and it gets loaded from there. In those cases, it does save the network time.