I'm not finding a definite answer on the web.
Lets say we have two sites both pull jquery
from the same CDN
.
pageOne.com
> mycdn.com/jquery
pageTwo.org
> mycdn.com/jquery
Now
pageOne.com
.jquery
is downloaded from mycdn.com/jquery
.pageTwo.org
(on second tab)Question:
Is jquery
downloaded again for pageTwo.org
(its the same CDN and the same jquery js file),
or can I use the browser cache for pageTwo.org
? (i have already downloaded it when I was on pageOne.com
before)
The single cached version is used for both sites. The URL for the jQuery library stays the same. It doesn't matter what references it.
This is one of the main benefits of using a common CDN for common libraries... the fact that the user will probably have cached it already from some other site.