Search code examples
jqueryhtmlpagespeed

jquery link from http or include in folder?


I want to ask which practise is better/faster(in terms of loading times) for javascripts like http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

I have the above script in my webpage like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Is it beter to donwload it to my web folder and link it localy?

 <script type="text/javascript" src="jquery.min.js"></script>

Will this move affect the loading times?Is it better html coding like this?

Thank you!


Solution

  • Unless you are doing an offline app, linking from google will generally speed up your app since there is a VERY good chance it is cached on someone's browser