August 15, 2014

Improving Website Speed with cdnjs


One of the ways to speed up a website is by offloading static content to other server. Static content includes images, and JS and CSS files.

Image files can be offloaded to popular image hosting web sites, such as Flickr, Imgur, Picasa, etc. While JS and CSS files can be offloaded to cdnjs.

Why cdnjs?

Although there are other script-hosting alternatives, such as Google Hosted Libraries, and Microsoft Ajax CDN, they only host most popular libraries. On the other hand, cdnjs has the most extensive, if not all, libraries.

Incorporating cdnjs

If you're using CMS, such as WordPress or Joomla, you can use cdnjs plugin. For other platform, you can manually offload JS and CSS by linking to the appropriate files in cdnjs with the script and link tags, respectively.

Improvements with cdnjs

After offloading all the JS and CSS files to cdnjs, I managed to reduce my website loading time to under one second. This is of course a much welcomed improvement, as no one likes to wait.

No comments :

Post a Comment

Contact Me