Skip to content Skip to sidebar Skip to footer

Files (jquery, Jquery Ui, Prototype) From External Server

If I have to load for example jquery.js file among some (let's tell about 10) other css / js files, what is a better approach? load all from the same server that I have my whole a

Solution 1:

Use Google. There's a good chance this will already be cached on the client's computer since lots of people use it, so it may be faster.

Solution 2:

Take a look here: Web Performance best Practices

Summarized:

ideally you should have all static content on subdomains like static1.example.org, static2.example.org. Which increases paralellity for downloads (increasing page load/render speed). in addition you should merge css files and js files, minify them and gzip them to reduce the number of roundtrips and the payload size. (mod_pagespeed is a apache module which can do this for you)

Also your content should be cached with a 1-year cache settings and version controlled (by naming convention, also available with mod_pagespeed)

Solution 3:

External servers, so called CDNs can be used to speed up the website, when e.g. they are located closer, or the file was used on another website and is already cached.

However, if your website is official, must be reliable, SaaS or whatever then using public CDNs is not advised. the option is then to buy commercial CDNs or host internally.

Post a Comment for "Files (jquery, Jquery Ui, Prototype) From External Server"