Let’s make the web faster

At Red Droid Software we are passionate about making our apps as effective and smooth as possible. Every step is taken to optimize for speed and efficiency. In that vein we strive to make the web faster. Why make the web faster? Because the web is central to a good mobile experience.

Android is the worlds most open and innovative mobile experience. And at Red Droid Software we get the potential of Android. Which is why we have been programming for the Android platform since nearly the beginning. In our time with Android we have realized that the quicker bits move across the network and the faster our code runs the happier our end users.

Google is a company that also yearns for speed. In 2009 they released multiple tools and tips to help tweak your website to achieve it’s maximize speed. Since we build on a Google platform and strive to provide the quickest and smoothest user experience available we thought we would take advantage of some of these tips.

So we will be trying out a few new things here and there. If you actually notice an increase in speed please let us know. However our site already loads pretty quick so I am guessing that any improvements will be beyond human perception.

Something that we began doing recently on our website that would surely make any XML well formed lover freak out is this:

To see how drastic this is consider the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Too Long</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href=".css"/>
</head>
<body>
<ul>
<li><a href="#">Home<a></li>
<li><a href="#">About<a></li>
<li><a href="#">Contact<a></li>
</ul>
</body>
</html>

By following google’s rules as outlined in the video above. The previous markup becomes this:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Much Better</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href=".css">
<ul>
<li><a href="#">Home<a>
<li><a href="#">About<a>
<li><a href="#">Contact<a>
</ul>

After all removing those implied closing tags and reducing the size of the doctype we reduced the file from 505 characters to 233 characters. That is a reduction of 46% characters. And that could have been reduced even further if we hadn’t emphasized the DOM structure by indenting descendant elements. (Which your not seeing because wordpress didn’t preserve it)

The file size may not be wildly different on this simple example. But imagine a page with hundreds or thousands of lines of markup and you can see how this might be a huge benefit.

Keep in mind that the above code is HTML not XHTML. Also keep in mind that this is an example of how we optimize to make our website faster. Rest assured that our Android XML is well formed and rock solid.

Leave a Reply