Js library in browser

Since web browsers want to make the Internet faster.

I know that Google has its hosted libraries. But why not integrate them directly into the browser?

The problem now is that if you are navigating from one page from jQuery to another page using jQuery, as the URL is different from the same js being cached for that particular URL. Thus, loading time takes longer when navigating between pages with the same libraries.

Can't they do something that saves most of the known libraries in the browser, so when you load jQuery or jQuery-min, it first looks for it in the browser.

Pros

- Fast navigation on the Internet.
- Makes 1 HTTP request less if it finds a library to load.

vs

Some issues that may arise with this are versions. Since most files have type names jquery.min.js, we cannot simply load them if they have the same name; on the other hand, some have /1.11.0/jquery.min.js. In this way, the browser may try to figure out the version with the URL. If the browser could not find the version, it just downloaded the file.

What do you think? Any suggestions on how this might work? Any other flaws?

Edit1: I know CDN. I suggest only a little faster CDN and make one HTTP request in the same process.

+4
source share
1 answer

Source: https://habr.com/ru/post/1530816/


All Articles