Cached libraries


A

Archos

Does the JavaScripts files dowloaded by the browsers are cached by
them?

Web1 uses library Lib1.1.0.js
Web2 use the same library

If the user goes to Web1 then he gots that library. Now, the user
closes the browser, open it again and he goes to Web2. Does
Lib1.1.0.js is already in her system?

My doubt is because I want to know if it's really useful to remove
functions of a library that they are not going to used by your
program. But if that library is cached, then it isn't better don't
touch it.
 
Ad

Advertisements

A

Archos

Does the JavaScripts files dowloaded by the browsers are cached by
them?

Web1 uses library Lib1.1.0.js
Web2 use the same library

If the user goes to Web1 then he gots that library. Now, the user
closes the browser, open it again and he goes to Web2. Does
Lib1.1.0.js is already in her system?

My doubt is because I want to know if it's really useful to remove
functions of a library that they are not going to used by your
program. But if that library is cached, then it isn't better don't
touch it.
Any comment about it? Thanks in advance!
 
Ad

Advertisements

M

Michael Haufe (TNO)

Does the JavaScripts files dowloaded by the browsers are cached by
them?

Web1 uses library Lib1.1.0.js
Web2 use the same library

If the user goes to Web1 then he gots that library. Now, the user
closes the browser, open it again and he goes to Web2. Does
Lib1.1.0.js is already in her system?

My doubt is because I want to know if it's really useful to remove
functions of a library that they are not going to used by your
program. But if that library is cached, then it isn't better don't
touch it.

Browsers will possibly cache the library on both websites if they
share the same location:

Website 1 and website 2 contains:
<script src="http://example.com/myLib.js">

This will probably not work:

Website 1 contains:
<script src="myLib.js">

Website 2 contains:
<script src="myLib.js">

There was a discussion IIRC involving resource hashing a few years ago
but I don't think anything came from it. Perhaps someone can recall in
more detail (and offer a link), but I believe there was a short
argument between Crockford and Eich on a similar topic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top