views:

66

answers:

3

If I visit 1 website www.abc.com that has a reference to say jQuery hosted at Google Code, and then I visit a 2nd website www.xyz.com that has the same reference - will the file be cached across both websites? i.e. will it re-download it on the 2nd website, or just use it from cache?

+4  A: 

It will use the cache. This is the exact reason why they are hosted by Google.

dionyziz
+1  A: 

Yes. That is the point of using the library hosted on their site.

Nate Bross
+1  A: 

Yes.

Also, if you use Google's loading api you get even faster loads then by just using the cache as it will use Google's CDN. For example:

<script src="http://www.google.com/jsapi?key=[inset Google API key here]">
<script type="text/javascript">
google.load("jquery", "1");
</script>
Adam
That's awesome - thanks everyone.
Marko