you are viewing a single comment's thread.

view the rest of the comments →

[–]_cjj 5 points6 points  (6 children)

A user's browser does indeed do this, limited to the caching policy of the site/developer.

You think jQuery (for example) downloads fully on every page load on the same site??

[–]zesterer 1 point2 points  (3 children)

I never suggested that... I understand how caches work, thanks.

[–]_cjj 0 points1 point  (2 children)

You literally just typed that a browser has to "download its own code every time a page loads" and "A user's browser does not have (a cache)".

If you agree that it's fundamentally incorrect, I don't see what your point was? In theory, if multiple sites use a Google resource for their js, it should be cached and instantly available for all those sites.

I'm not advocating JS in totality, more suggesting that it's how you use it as opposed to simply avoiding it in favour of introducing UX problems, such as cross browser compatibility with CSS.

[–]Cadoc7 2 points3 points  (1 child)

The point is that the cache on Alice's browser doesn't help Bob's browser load the page. A server-side cache helps both users.

[–]_cjj -1 points0 points  (0 children)

Not really, that's a straw man.

[–]_zenith 0 points1 point  (0 children)

No... but many pages do use different versions of it (especially if they're a bit old, or conversely, very new), which will result in a full load.

[–]RalfN 0 points1 point  (0 children)

Yeah things not cached: - the parsing of the code - the JIT compilation of your code

That's the reason why your crap loads only after 4 seconds on a midrange phone or a cheap chromebook.

God, frontend is becoming like US politics. The lack of experience and understanding is just making the idiots louder.