Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Why we use Google/jQuery CDN to load JS/CSS library files

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 182
    Comment on it

    Hello readers, today I will guide you "Why we use Google/jQuery CDN to load JS/CSS library files".

    Here are the following reasons on behalf of Why we should use Google/jQuery  CDN to load JS/CSS library files.

     

    1) This increases the chance of cache-hit.

    As now-a-days maximum sites are following this practice which implies that more users already have the file ready in their browser {refuge|voile}. This way cache strike will increase and storage space call will decrease.

     

    2) This increases the parallelism.
    To avoid the unnecessary insert from your server all browsers built on a concept so most of concurrent connection to a specific server is fixed which count is different for different browser. So reloading library files from the different server will raise the parallelism and it is also an intelligent job.

     

    3) It makes sure that the minimum size data file will load.
    Google/jQuery CDN ensures that these data files are pre-compress in a wide array of types (like GZIP or DEFLATE) which ensures the time-to-download the file very small.

     

    4) It reduces the amount of bandwidth used by your own server.
    In case your site loads files from Google/jQuery CDN it means you are using their storage space bandwidth which is free of cost.

     

    5) It ensures minimum time will be taken to load data files.
    Google/jQuery has servers across the world which ensures that the requested file(s) will insert from the closest CDN server.

     

    6) They will always maintain your JS/CSS library up-to-date.
    Google/jQuery server will up-to-date JS/CSS library files regularly to their latest secure version so that you will always be up to date.

     

    Example:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script>
      $(document).ready(function() {
        // write  your code here
      });
    </script>

     

    Now I am sure that you are curious to know why I am not using http: and start with //. The reason is that, this way will allow you to use a single reference that works on both HTTP and HTTPS page. So depending upon your page url jQuery file protocol will be http or https.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: