<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>badlyDrawnToy &#187; Web Development</title>
	<atom:link href="http://www.badlydrawntoy.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://badlydrawntoy.com</link>
	<description>when all's said and done, at the end of the day...</description>
	<pubDate>Wed, 19 Nov 2008 22:44:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Goodbye Java, Hello World</title>
		<link>http://badlydrawntoy.com/2008/06/27/goodbye-java-hello-world/</link>
		<comments>http://badlydrawntoy.com/2008/06/27/goodbye-java-hello-world/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 14:11:11 +0000</pubDate>
		<dc:creator>Howie</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Digital PR]]></category>

		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://www.badlydrawntoy.com/2008/06/27/goodbye-java-hello-world/</guid>
		<description><![CDATA[As mentioned in my previous post, I&#8217;m about to move back to freelance web design, and away from full-time Java web development. As of Monday, I will no longer be a contractor, and will be partnering with Stan PR as their web technologist. So, I&#8217;ve been re-assessing my skillset, and re-examining the current state of [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in my previous post, I&#8217;m about to move back to freelance web design, and away from full-time Java web development. As of Monday, I will no longer be a contractor, and will be partnering with<a href="http://www.stanatwork.com/"> Stan PR</a> as their web technologist. So, I&#8217;ve been re-assessing my skillset, and re-examining the current state of the ever-changing <em>world of web</em>. I think it&#8217;s time to say goodbe to Java, and hello to a new set of web frameworks and technologies.<br />
<span id="more-87"></span><br />
Java is a great language, and well suited for the large projects I&#8217;ve worked on in the past, particularly banking. However, I choose to specialise in web application development, and whilst Java is an extremely robust language, it is not the quickest language to develop in.</p>

<p>I certainly intend to keep my Java skills up to date, but I think the framework <em>stack</em> is fairly well established for the while: Java + <a href="http://www.springframework.org/">Spring </a>+ <a href="http://hww.hibernate.org/">Hibernate</a> + <span class="caps">MVC </span>(<a href="http://www.opensymphony.com/webwork">WebWork </a>would be my choice). This framework stack delivers pretty well, and whilst improvements will come along, I don&#8217;t envisage a sea-change in how web-applications are delivered, for a while.</p>

<p>I do however forsee some fairly fundamental groundshift in how web sites, or more precisely, web applications are <strong>developed</strong> (not delivered). The change in emphasis is that functionality is moving from the (web) server to the client (browser).</p>

<p>These emerging technologies (and challenges) place new demands on the web designer/developer. Gone are the days of a web designer slicing and dicing a photoshop image into a slick, brochure web site. Nowadays the developer must learn how to programme the client.</p>

<p>The demand for Rich Internet Applications (RIA) is moving the web forward with giant leaps. <span class="caps">AJAX</span>/XHR is now well established, and in recognition of this requirement, the latest web browsers have worked hard to improve Javascript performance, as have the developers of the cross-browser Javascript libraries (JQuery, Prototype, DoJo, MooTools etc).</p>

<p>The next evolutionary stage is to provide support for offline-browsing, whereby browsers can synchronise locally held data with the web server. Firofox supports this, as does Google Gears, Adobe <span class="caps">AIR </span>and Microsoft Silverlight. The <span class="caps">HTML5 </span>spec. will eventually provide some standards around this feature.</p>

<p>These two technologies, alongside the adoption of next-generation mobile phones (3G iPhones are imminent) plus a fervent appetite for social networking(FaceBook, LinkedIn, Twitter) are driving a demand for <span class="caps">RIA.</span> Savvy business leaders are recognising this; The phrase <em>Digital PR</em> is becomign common parlance. I, along with Stan <span class="caps">PR, </span>hope to be able to fulfill these demands.</p>

<p>So, from a technology perspective, I need to re-skill. Java will always be there, but it&#8217;s time to concentrate on client technologies. Look forward to blog entries about <span class="caps">AJAX,</span> Adobe Flex, iPhone development and Social Networking.</p>

<p>I&#8217;ll also be blogging about <span class="caps">PHP, </span>or more specifically, <a href="http://www.cakephp.org/">CakePHP</a>. Why? Well, that&#8217;s a blog post of it&#8217;s own, but if I&#8217;m going to abandon Java, then I still need to deliver web content. <span class="caps">PHP </span>is quick and easy. CakePHP is a mature <span class="caps">PHP </span>framework providing a wealth of functionality. Sure, Ruby or Python are more powerful languages, but for now, I need to get up and running as quickly as is possible. As of Monday, I enter a whole new world.</p>]]></content:encoded>
			<wfw:commentRss>http://badlydrawntoy.com/2008/06/27/goodbye-java-hello-world/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Speed Up Your Web Site With Firebug and YSlow</title>
		<link>http://badlydrawntoy.com/2007/12/18/speed-up-your-web-site-with-firebug-and-yslow/</link>
		<comments>http://badlydrawntoy.com/2007/12/18/speed-up-your-web-site-with-firebug-and-yslow/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 12:27:58 +0000</pubDate>
		<dc:creator>Howie</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[firebug web site speed]]></category>

		<category><![CDATA[web site optimisation]]></category>

		<category><![CDATA[yslow]]></category>

		<guid isPermaLink="false">http://www.badlydrawntoy.com/2007/12/18/speed-up-your-web-site-with-firebug-and-yslow/</guid>
		<description><![CDATA[I recently convinced a friend that the Firebug plug-in for Mozilla FireFox is an essential development tool. Well, it&#8217;s now time for me to praise YSlow, an extension to Firebug provided by Yahoo!, that analyses your web site, and recommends how to improve performance in the way of download speed. So if you want to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently <a href="http://www.rumble.net/blog/index.cgi/2007/12/05#Firefox_extensions2">convinced a friend</a> that the <a href="http://www.getfirebug.com/">Firebug plug-in</a> for Mozilla FireFox is an essential development tool. Well, it&#8217;s now time for me to praise <a href="http://developer.yahoo.com/yslow/">YSlow</a>, an extension to Firebug provided by Yahoo!, that analyses your web site, and recommends how to improve performance in the way of download speed. So if you want to learn how to speed up your web site, read on.<br />
<span id="more-80"></span></p>









<p>I&#8217;ve known about YSlow for some time. I analysed my site a while back, saw what needed to be done, but until recently did nothing. Much of what the plug-in recommended was not new to me. It was one of those tasks that I just never got round too.</p>

<p>However, having recently given <a href="http://www.microbubble.net/">my company website</a> a facelift, I thought it was an opportune time to make amends. By providing a measurable benchmark (and even a score), YSlow can show you instantly what affect your site optimisations have made.</p>

<p>Some of the recommendations provided by YSlow, might not be available depending on your hosting set up, but most of the  improvements are gained by applying common optimisations. Namely:</p>


<ul>
<li>compression of web assets</li>
<li>setting <span class="caps">HTTP</span> Expires Headers on web assets</li>
<li>minimising <span class="caps">CSS </span>and Javascript</li>
<li>combining <span class="caps">CSS </span>and Javascript into fewer files</li>
</ul>



Much of the above can be achieved pretty easily thanks to some great free tools now available (see below).<br />
<img src="http://badlydrawntoy.com/wp-content/uploads/2007/12/before1.jpg" alt="before.jpg" border="0" width="385" height="180" align="left" />
<p style="clear:both"><strong>before optimisation</strong></p>
<img src="http://badlydrawntoy.com/wp-content/uploads/2007/12/after1.jpg" alt="after.jpg" border="0" width="384" height="180" align="left" />
<p style="clear:both"><strong>after optimisation</strong></p>

<p>Above is a snapshot of my YSlow metrics before and after optimisation. I managed to reduce the initial download size by 50 per cent, and decrease the number of <span class="caps">HTTP </span>requests from 18 to 11. These are the <strong>initial</strong> figures, before the cache is primed. In my case, the gains made after assets have been cached, were mainly with regard to the number of <span class="caps">HTTP </span>requests being made - reduced from 17 prior to optimisation, down to a single request.</p>

<p>Optimisation was relatively easy. Here&#8217;s how the improvements I made.</p>

<p>###Compression of web assets<br />
Compressing the web assets reduces the payload size of each web request. Anything that is not already compressed (such as images) should be. The downside to compression is that the client (browser) must inflate the content upon receipt, but for many home computers these days, the processing power is ample for this task. Similarly, the server must deflate the content prior to sending it, thus putting a load on the server.</p>

<p>If your content is static, one approach is to compress all your assets and upload them to your web server, alongside the uncompressed assets. If you&#8217;re using Apache web server, a few Content Negotiation rules can then be added to the Apache config files to return the compressed assets, if the client supports it (the request headers indicate if compression is supported).</p>

<p>Another approach is to compress assets on the fly using Apache modules such as <a href="http://www.freebsdmadeeasy.com/tutorials/web-server/apache-mod-deflate.php">mod_deflate</a> (Apache 2) or <a href="http://www.sitepoint.com/article/web-output-mod_gzip-apache">mod_gzip</a> (Apache 1.3). This does put some load on the server, and may not always be supported by your web host (mine didn&#8217;t allow it).</p>

<code>
&amp;lt;?php
    ob_start( &amp;#x27;ob_gzhandler&amp;#x27; );
?&amp;gt;
</code>

<p>I went for a simpler solution. My site is templated using <span class="caps">PHP, </span>so adding these few lines to the top of my template header, compresses all the <span class="caps">PHP </span>web pages. The remaining web assets - <span class="caps">CSS </span>and Javascript are handled seperately (see below)</p>

<p>###Setting Expires Headers<br />
Nothing new here, but how many web designers/developers think about ensuring that expiry headers are set correctly? There&#8217;s no rules as to what expiry to set. It all depends on what the site does. <span class="caps">BBC</span> News won&#8217;t want to cache their content for too long, but don&#8217;t want every hit to request their servers, so they set their content to expire after 10 minutes. My site content doesn&#8217;t change daily, so I set it to expire after one week.</p>

<p>Again, I used Apache rules to set both the <span class="caps">HTTP</span> Expires Header and the <a href="http://en.wikipedia.org/wiki/HTTP_ETag">ETags</a>, which had the desired effect. My rules in my .htaccess file were as follows:</p>

<code>
&amp;lt;IfModule mod_expires.c&amp;gt;
 ExpiresActive on
 ExpiresDefault &amp;quot;access plus 7 days&amp;quot;
&amp;lt;/IfModule&amp;gt;
FileETag MTime Size
</code>

<p>###Minimising and Combining <span class="caps">CSS</span> JavaScript<br />
This is where optimisation gets clever. It&#8217;s a given that reducing white space or minifying <span class="caps">CSS </span>and Javascript files will reduce the payload size. The clever bit is in reducing the number of <span class="caps">HTTP </span>requests, by combining the files before minifying them. With the adoption of Javascript libraries such as <a href="http://jquery.com/">JQuery</a>, <a href="http://www.prototypejs.org/">Prototype</a> etc. plus the inevitable breakdown of <span class="caps">CSS </span>files into more manageable files, there is plenty of opportunity for optimisation here.</p>

<p>I used <a href="http://rakaz.nl/extra/code/combine">Combine</a>. Simply drop <strong>combine.php</strong> into the root folder of my web application, and modify my <span class="caps">HTML </span>to call this script rather than <span class="caps">URI </span>to the various assets as shown below. Before I used combine, my <span class="caps">HTML </span>header referenced 12 <span class="caps">CSS </span>and Javascript assets. After using combine, this was reduced to just four.</p>

<code>
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/css/reset-fonts-grids.css,base-min.css,styles.css,thickbox.css&amp;quot;/&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/js/jquery-1.2.1.js,jquery.easing.1.3.js,jquery.scrollTo-min.js,jquery.corner.pack.js,thickbox.pack.js,microbubble.pack.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;</code>

<p>There are a other tools around like Combine such as <a href="http://code.google.com/p/minify/">minify</a>,  though I had problems with it combining some of the <span class="caps">CSS </span>files due to the presence of <a href="http://www.webdevout.net/css-hacks"><span class="caps">CSS </span>hacks</a>.</p>

<p>###Summary<br />
As many of us web developers now use fast broadband connections, it&#8217;s easy to forget and ignore those less fortunate souls who, for one reason or another, are still on slower connections. YSlow is a quick, simple and measurable reminder of how we can improve the overall user experience with a few server-side configuration changes. It took me about 20 minutes to sort my site out, and in the future, it will take just minutes. You&#8217;ve no excuse!</p>]]></content:encoded>
			<wfw:commentRss>http://badlydrawntoy.com/2007/12/18/speed-up-your-web-site-with-firebug-and-yslow/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.599 seconds -->
