Tips and Tricks

There are few simple rules that can help you create website and web applications that download remarkably fast,  some of these rules have to do with JavaScript, CSS, HTML,  server configuration and HTTP  requests. I use/recommend Page Speed to help analyzing the performance of my web pages. In this post I will talk about rules concerning JavaScript.

  • Write efficient code,  where every line serves a purpose, avoid unnecessary loops and stuff like that.
  • Load only JavaScript files/resource needed for the current page, if possible.
  • Defer the parsing of JavaScript(load your code asynchronously), chances are your JavaScript code is not needed during initial page load. read more here.
  • Combine your external JavaScript files, this will reduce the number of HTTP requests needed, therefore decreasing page load time. This doesn’t mean you shouldn’t develop your code in a modular way, which is the way that makes more sense most of the time, just combine this file on the server, using a server side script loader.   read more here.
  • Minify JavaScript, Minification is the process of removing all unnecessary characters from source code, without changing its functionality. There are many free tools to do this, I personally use  YUI Compressor.

Let me know if you have other tips that help make code run faster in the browser, by commenting below.

Advertisements

Comments on: "How to make your websites download and run fast [part one]" (1)

  1. Nice! can’t wait for part two.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: