<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edward Yarnold &#187; Optimisation</title>
	<atom:link href="http://www.edwardyarnold.co.uk/blog/category/web-development/optimisation/feed" rel="self" type="application/rss+xml" />
	<link>http://www.edwardyarnold.co.uk/blog</link>
	<description>PHP &#38; MySQL Web Developer</description>
	<lastBuildDate>Mon, 12 Dec 2011 18:12:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Does your website still need to be functional with Javascript disabled or unsupported?</title>
		<link>http://www.edwardyarnold.co.uk/blog/does-your-website-still-need-to-be-functional-with-javascript-disabled-or-unsupported</link>
		<comments>http://www.edwardyarnold.co.uk/blog/does-your-website-still-need-to-be-functional-with-javascript-disabled-or-unsupported#comments</comments>
		<pubDate>Wed, 10 Nov 2010 08:43:37 +0000</pubDate>
		<dc:creator>Ed Yarnold</dc:creator>
				<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Optimisation]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.edwardyarnold.co.uk/blog/?p=149</guid>
		<description><![CDATA[We have recently been reviewing the amount of development time spent on projects, and have identified one area where a fair chunk of extra time is spent for relatively little gain: Ensuring that web sites are 100% functional with Javascript disabled. The general concensus on the web is that year on year, the number of [...]]]></description>
			<content:encoded><![CDATA[<p>We have recently been reviewing the amount of development time spent on projects, and have identified one area where a fair chunk of extra time is spent for relatively little gain: Ensuring that web sites are 100% functional with Javascript disabled.  The general concensus on the web is that year on year, the number of people (even those technical in nature that browse w3schools) with javascript disabled <a href="http://www.w3schools.com/browsers/browsers_stats.asp">is falling</a> &#8211; but is this a decent reason to consider removing the true graceful degradation that most front end developers have been obsessed with for the last few years?<br />
<span id="more-149"></span></p>
<p>The main reason for Javascript being used to progressively enhance the user experience rather than be a fundamental &#8216;requirement&#8217; is cited as making the site accessible to as many people as possible.  Importantly, many mobile devices don&#8217;t fully support Javascript (Smart Phones tend to, but I&#8217;m talking true mobile phones here) and screen readers certainly don&#8217;t support Javascript.  Realistically, the percentage of visitors falling in to the &#8216;browsing on a mobile device&#8217; or &#8216;using a screen reader&#8217; will be low, and often low enough for a client (or yourself) to make the judgement &#8220;we&#8217;re not going to bother&#8221;.  It is important to consider that there are advantages to graceful degradation other than making the site as accessible as possible:</p>
<p><strong>Google, Bing, and A.N.Other search engines</strong> &#8211; search engine spiders are still fairly basic creatures.  If your site navigation doesn&#8217;t load a new page but instead loads new content in using Ajax when you click the &#8216;About&#8217; link, how are search engines going to find and index your &#8216;About&#8217; page content if the site is not navigable without Javascript?  It&#8217;s quite simple to make things like this degrade; if Javascript is disabled the link should go to index.php?page=about rather than nowhere.  Importantly, many clients think that <strong>google is the most important visitor</strong>; if they&#8217;ve forced you to put lots of keywords at the bottom of the site despite your pleas for them not to then they wouldn&#8217;t be very pleased to find out that the search engines can&#8217;t get any further than your home page.</p>
<p><strong>Application Design</strong> &#8211; Designing the application so that it works without Javascript and then adding Javascript afterwards often makes the system architecture much more understandable and &#8216;rigid&#8217;.  In fact, if done correctly, this can speed up the Javascript implementation process.  Looking back to our previous example, index.php?page=about will load a completely new version of the page with header, footer and all the bells and whistles.  How about, if you click the &#8216;About&#8217; link with javascript enabled, it will load index.php?page=about but through AJAX?  Using HTTP_X_REQUESTED_WITH we can detect that it was requested through AJAX and serve just the &#8216;meaty&#8217; bit of the page; ie the content that is changing, rather than the whole page.  Does this really add much time to the development process?  In my opinion, no it doesn&#8217;t!</p>
<p>Of course, the user experience will not be identical without javascript, but in my view it is still important to support users with no support for the language on their device, or even those that choose to browse without it.  It is my view that you can treat support for when Javascript disabled in the same way as many designers treat support of Internet Explorer 6: The site should work, but it doesn&#8217;t necessarily have to be perfect.  Sticking to this general guideline will not add huge amounts of time to the development time of a project, and if it does&#8230; you should take a look at how the system is designed, because it really shouldn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edwardyarnold.co.uk/blog/does-your-website-still-need-to-be-functional-with-javascript-disabled-or-unsupported/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Some simple steps on the &#8220;front end&#8221; to reduce web page download time</title>
		<link>http://www.edwardyarnold.co.uk/blog/some-simple-steps-to-reduce-web-page-download-time</link>
		<comments>http://www.edwardyarnold.co.uk/blog/some-simple-steps-to-reduce-web-page-download-time#comments</comments>
		<pubDate>Wed, 14 Jul 2010 07:48:13 +0000</pubDate>
		<dc:creator>Ed Yarnold</dc:creator>
				<category><![CDATA[Optimisation]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.edwardyarnold.co.uk/blog/?p=125</guid>
		<description><![CDATA[A few years ago, page download time was a big focus for most web developers, as the majority of people connected to the internet were accessing through &#8220;dial up&#8221; connections, which we all remember for their awful connection noises and the horrific download speeds.  But with the development of faster internet connections in the developed [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago, page download time was a big focus for most web developers, as the majority of people connected to the internet were accessing through &#8220;dial up&#8221; connections, which we all remember for their awful connection noises and the horrific download speeds.  But with the development of faster internet connections in the developed world, the focus on page load times has been sacrificed for nice looking graphics, chunky javascript libraries and massive CSS files.  But there are some quick, simple steps that can be taken to keep all of the improved functionality and look of a web site but reduce the page load time a little.<br />
<span id="more-125"></span><br />
Before I get in to the tips themselves, here are a few basic rules of web site optimisation:</p>
<ul>
<li>HTTP requests are <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/">expensive in terms of time</a>.  Reducing the number speeds page load time.</li>
<li>Browsers can &#8211; and do &#8211; cache effectively.  Inline CSS and Javascript can&#8217;t be cached for later page requests.</li>
<li>Images can be optimised on the web without any major loss in visual quality.</li>
</ul>
<h2>Javascript Files</h2>
<h3>Minify Them!</h3>
<p>Firstly, remember that if you are including libraries such as jQuery, there are a few ways in which you can do so.  They offer a &#8220;minified&#8221; or &#8220;compressed&#8221; version, which is at least half the size in KB of the uncompressed version.  Given that you are extremely unlikely to need to ever modify the jQuery core, I don&#8217;t see any argument for including the full version of the library, and would choose to include the smaller, minified version every time.</p>
<p>If you have your own javascript files that are particularly hefty, you can minify those for production sites too, by using tools such as <a href="http://www.crockford.com/javascript/jsmin.html">JSMin</a>.  The only problem with doing this is you tend to need to maintain two versions of the file.  The minification process tends to be irreversible so you will need to keep a &#8220;development&#8221; copy of the javascript, just in case you need to make changes or additions in the future.</p>
<h3>Use a Content Delivery Network for your javascript libraries!</h3>
<p>If you want to go one step further, you can include libraries such as jQuery from &#8220;Content Delivery Networks&#8221;.  Here is what wikipedia defines a CDN as:</p>
<blockquote><p>A content delivery network or content distribution network (CDN) is a  system of computers containing copies of data, placed at various points  in a network so as to maximize bandwidth for access to the data from  clients throughout the network</p></blockquote>
<p>Put simply, CDNs are probably much more capable of delivering the javascript files to the web browser accessing your page quickly and reliably than your own server.  Additionally, remember that this means that the CDN is taking some of your bandwidth costs away &#8211; at least 50kb per new visitor.  An additional strange secondary advantage is that it is possible that the user has previously visited a page including the javascript library from the same CDN earlier in their internet browsing session, so it will already be cached in their machine, and will not need to be loaded for a second time.</p>
<p>If you are looking for a quick link to the Google Javascript CDN,  you can access it here:</p>
<p><a href="http://code.google.com/apis/ajaxlibs/">http://code.google.com/apis/ajaxlibs/</a></p>
<h3>Include them only when they are needed!</h3>
<p>Imagine that you have a &#8220;google map&#8221; page on your web site that integrates with the Google Maps API.  You have a fairly chunky 15kb Javascript file that handles your personal Google Maps integration, as well as including Google&#8217;s own API file for the maps.  Why would you want this javascript on every page of the site?  A lot of web developers and designers are guilty of putting the javascript in every single page of the site, which means that the request and corresponding bandwidth associated with the maps integration would be used even if the visitor never viewed that area of the site.</p>
<h2>Images</h2>
<p>This section is going to be quite short, as it isn&#8217;t really my department, but my main understanding is:</p>
<ul>
<li>Adobe Photoshop has a save for web feature. Use it.</li>
<li>Application specific META data is not needed in images on the web (I understand that Adobe Photoshop again can be a devil for this). Remove it if you can!</li>
<li>If you have &#8220;hover&#8221; states on buttons or navigation items, use <a href="http://www.alistapart.com/articles/sprites">CSS Sprites</a> rather than two separate images.  The reasons why are explained in the link supplied, but mainly revolve around making the hover work immediately, and reducing the number of HTTP requests.</li>
</ul>
<h2>CSS</h2>
<p>There are two situations here, really.  The majority of the time, most of the CSS will be used on all of the pages of the site, so it makes sense to make this one external cacheable file.  It is important that the CSS isn&#8217;t included in &lt;style type=&#8221;text/css&#8221;&gt;&lt;/style&gt; tags in the document itself, as this information is not cacheable and will be individually reloaded on the following page.</p>
<p>A lot of sites will include two or three CSS files. One for the site itself, and one for a plugin such as &#8220;lightbox&#8221; or &#8220;slimbox&#8221; or something similar.  If lightbox/slimbox is used on most pages, why not combine the CSS files in to one slightly larger one?  This will reduce the number of HTTP requests and put all of the CSS in to a single cached file.</p>
<p>There is an argument, also, that if there is a particularly complicated section of the web site that takes up 10kb of a CSS file all by itself, then that 10kb of the CSS should be split out in to a separate css file and included only in the complicated section, where it is needed.  This kind of optimisation will need to be assessed on a per-case basis!</p>
<p>Finally, remember that css itself can be written efficiently.</p>
<p>Compare these two blocks of code, which do the same thing, and you will see what I mean!</p>
<p><code><br />
margin-top: 10px;<br />
margin-bottom: 15px;<br />
margin-right: 5px;<br />
margin-left: 2px;<br />
</code></p>
<p><code><br />
margin: 10px 5px 15px 2px;</code></p>
<p>In conclusion, the steps above often take less than an hour to implement on a well built web site, and can save a couple of seconds per page load, and a fair amount of bandwidth costs.  With google&#8217;s <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">recent introduction of a small focus on page load time in terms of a web site&#8217;s ranking</a>, these kind of improvements have more benefits than just making the site appear faster, and are worth paying some attention!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edwardyarnold.co.uk/blog/some-simple-steps-to-reduce-web-page-download-time/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

