<?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>RetroFit9</title>
	<atom:link href="http://retrofit9.com/feed" rel="self" type="application/rss+xml" />
	<link>http://retrofit9.com</link>
	<description>Agile Web Development and Web Site Optimization</description>
	<lastBuildDate>Sun, 26 Jun 2011 22:15:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>PHP Steps Up Documentation Effort</title>
		<link>http://retrofit9.com/blog/2011/php-steps-up-documentation-effort</link>
		<comments>http://retrofit9.com/blog/2011/php-steps-up-documentation-effort#comments</comments>
		<pubDate>Sun, 26 Jun 2011 18:24:04 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=90</guid>
		<description><![CDATA[PHP has some of the best centralised documentation of any programming language. Several years ago they introduced user-contributed comments, which allowed developers a quick way to plug any holes they found. Unfortunately, with the new features introduced in 5.2 / 5.3, as well as more general advances in practices, a lot of these comments are [...]]]></description>
			<content:encoded><![CDATA[<p>PHP has some of the best centralised documentation of any programming language. Several years ago they introduced user-contributed comments, which allowed developers a quick way to plug any holes they found. Unfortunately, with the new features introduced in 5.2 / 5.3, as well as more general advances in practices, a lot of these comments are now very dated. Some of them were downright wrong when they were posted.</p>
<p>Now though, PHP.net has made it&#8217;s documentation fully editable by members of the public through a web-based <a href="http://www.docbook.org" title="DocBook Format">DocBook</a> editor at <a href="https://edit.php.net" title="PHP Online DocBook Editor">https://edit.php.net</a>. We&#8217;re hoping that this will lead to even greater quality of documentation and remove the need for some of the older comments (despite the occasional glaring inaccuracy, most &#8220;wiki&#8221; benefit hugely from peer review).</p>
<p>The PHP manual has also been released in some additional formats &#8211; an extended CHM file with all the user-contributed comments, and a text-based package accessed from the command-line in the same way as Unix man pages (in fact the command is simply &#8220;pman&#8221;). We&#8217;ve wasted no time in adding commands to our various editors to take advantage of this (previously we&#8217;d launch a browser window with a keyword search).</p>
<p>Finally, there&#8217;s an slightly odd footnote about a future release of the manual in JSON format. We&#8217;re not sure what their plan behind this was, but having the manual in an easy-to-use structured format can be no bad thing.</p>
<p>See the news on <a href="http://www.php.net/archive/2011.php#id2011-06-25-1" title="PHP Documentation Update (php.net)">PHP.net here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/php-steps-up-documentation-effort/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS Caching in Performance Tests</title>
		<link>http://retrofit9.com/blog/2011/dns-caching-in-performance-tests</link>
		<comments>http://retrofit9.com/blog/2011/dns-caching-in-performance-tests#comments</comments>
		<pubDate>Tue, 05 Apr 2011 19:37:43 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[caches]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hosts]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=51</guid>
		<description><![CDATA[We found a post recently talking about performance increases gained from using the HTML5 Boilerplate system. Whilst we&#8217;re sure the changes it made to stylesheets and Javascript files will have made some difference, the claim was backed up by some very questionable performance graphs. Amongst other issues, it was clear from the graphs that a [...]]]></description>
			<content:encoded><![CDATA[<p>We found a post recently talking about performance increases gained from using the HTML5 Boilerplate system. Whilst we&#8217;re sure the changes it made to stylesheets and Javascript files will have made some difference, the claim was backed up by some very questionable performance graphs.</p>
<p>Amongst other issues, it was clear from the graphs that a large part of their speed increase between the two tests was the lack of a DNS lookup in the second test. In this case, there seemed to be many changes made at the same time, which understandably makes proper benchmarking somewhat difficult. Even if that wasn&#8217;t the case though, there is a lot that can be done to stop DNS from interfering with your tests.</p>
<h3>Where&#8217;s the Cache?</h3>
<p>The problem with DNS is that it is cached in so many different places. There&#8217;s a browser cache, an operating system cache, the cache at your ISP and possibly a few up-stream from them as well. We also need to think about other internal systems such as caching proxies that may be setup on your local network.</p>
<p>Only some of these caches are under our control &#8211; namely the browser, the operating system and possible a proxy. Clearing these between each test may help a little, but what of the caches located up-stream that we have no control over?</p>
<h3>Compensating for DNS</h3>
<p>Every tool we&#8217;ve seen for measuring website speed separates the retrieval of files into several stages, one of which is the time taken to process the DNS query. It&#8217;s possible to subtract these values from the overall retrieval time but if you&#8217;re doing in-depth analysis of page load then there may be two, three or more domains being accessed. It soon becomes unmanageable to carry these calculations forward through dependencies and blocking.</p>
<h3>Eliminating It Altogether</h3>
<p>Enter our saviour in this situation &#8211; the &#8220;hosts&#8221; file. A hosts file exists as an override to the DNS system. It is a tab-separated list of domains names and corresponding IP addresses. When doing any sort of performance work, we can manipulate the hosts file so DNS lookups are not performed at all. Instead, information is retrieved from our local filesystem &#8211; a task that won&#8217;t vary by much more than a few microseconds between tests.</p>
<p>Unix, Linux and Mac system are pretty standard and keep the hosts file under /etc/hosts or /etc/HOSTS. <a href="http://en.wikipedia.org/wiki/Hosts_%28file%29" title="Wikipedia Entry for Hosts File">Hosts files on Windows</a> vary depending on the version being run.</p>
<h3>DNS Speed</h3>
<p>Of course, this is not to say that you shouldn&#8217;t test your DNS speed as well. Many companies never move their domains away from the budget registrars they started with, so DNS can be a big contributor to slow-loading sites. Just try to test one thing at a time.</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/dns-caching-in-performance-tests/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silex Microframework Installation, Tutorial and Example Program</title>
		<link>http://retrofit9.com/blog/2011/silex-getting-started</link>
		<comments>http://retrofit9.com/blog/2011/silex-getting-started#comments</comments>
		<pubDate>Tue, 29 Mar 2011 21:04:46 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[microframeworks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[silex]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[twig]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=57</guid>
		<description><![CDATA[Silex is a microframework derived from it&#8217;s big brother Symfony. It&#8217;s described as a simple framework to develop simple websites but as it&#8217;s in active development, getting it up and running can be a little tricky. We&#8217;re going to do just that and then go through a quick example application to get things moving. Getting [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/fabpot/Silex" title="Silex on GitHub">Silex</a> is a microframework derived from it&#8217;s big brother <a href="http://symfony.com/" title="Symfony 2 Project Homepage">Symfony</a>. It&#8217;s described as a simple framework to develop simple websites but as it&#8217;s in active development, getting it up and running can be a little tricky. We&#8217;re going to do just that and then go through a quick example application to get things moving.</p>
<h2>Getting the Source</h2>
<p>As Silex draws on part of the Symfony framework, there&#8217;s quite a lot of source code to get down and into the right places. It uses git&#8217;s submodules system to pull in various other repositories that it requires. If you download our <a href="/downloads/silex.phar.zip" title="Pre-compiled Version of Silex (silex.phar)">compiled Silex Phar file</a>, you can pick up at the &#8220;Sample Application&#8221; step.</p>
<p>If you&#8217;re running one of the latest versions of git, you can use the &#8220;&#8211;resursive&#8221; option to sort the submodules out, but it&#8217;s more likely that you&#8217;ll need to take a couple of extra steps:</p>
<pre>
git clone https://github.com/fabpot/Silex.git
cd Silex
git submodules init
git submodules update
</pre>
<p>To compile to a Phar file, run the following:</p>
<pre>
php Silex/compile
</pre>
<p>If you run into problems at this stage you may need to alter a couple of the configuration options for Phar. Open up your &#8220;php.ini&#8221; file and make sure the following options are set:</p>
<pre>
phar.readonly = Off
phar.require_hash = Off
</pre>
<h2>Sample Application</h2>
<p>With the compile script run without any problems, we have an archive called &#8220;silex.phar&#8221; in the folder we were working from. We copy this file into the root of our web application and create an &#8220;index.php&#8221; to hold our code.</p>
<p>Silex makes it very simple to create a basic application through the use of simple REST-like functions and PHP 5.3&#8242;s closures (or anonymous functions). First, we set up Silex by including the autoloader, telling it that we&#8217;re using the namespaced Silex\Application class and then instantiating that class:</p>
<pre>
require 'phar://silex.phar/autoload.php';
use Silex\Application;
$app = new Application();
</pre>
<p>We can now start to configure the routes of our application, starting with a standard output for &#8220;/&#8221;, the document root. At the end of the script we call the application&#8217;s run method to kick things off.</p>
<pre>
$app->get('/', function() {
	return "Index Page";
});
$app->run();
</pre>
<p>Now if we visit &#8220;http://localhost/app/index.php&#8221;, we&#8217;ll see the message &#8220;Index Page&#8221; in the browser. The real flexibility comes when we use variables in our routing and in our closures. We add this code to our script <strong>before the application&#8217;s run method</strong>.</p>
<pre>
$app->get('/hello/{name}', function($name) {
	return 'Hello '.$name;
});
</pre>
<p>By creating a route with part of it surrounded by braces, we annex that part as a variable. This then gets passed into our function so it can be used like any other variable within a function. If we visit our application at &#8220;http://localhost/app/index.php/hello/Kryten&#8221;, we&#8217;ll see the message &#8220;Hello Kryten&#8221; in the browser.</p>
<h3>Futher Reading</h3>
<p>We love Silex so we&#8217;ll be featuring it a lot over the coming months as it matures. In the meantime, there&#8217;s the <a href="https://github.com/fabpot/Silex" title="Silex Microframework on GitHub">Silex page on GitHub</a> and slides from <a href="http://www.slideshare.net/IgorWiedler/silex-the-symfony2-microframework" title="Presentation: Silex - the Symfony2 Microframework">this Silex presentation by Igor Wielder</a>. Be careful though as some of the examples used in the presentation are no longer valid.</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/silex-getting-started/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics Deprecates Connection Speed</title>
		<link>http://retrofit9.com/blog/2011/google-analytics-deprecates-connection-speed</link>
		<comments>http://retrofit9.com/blog/2011/google-analytics-deprecates-connection-speed#comments</comments>
		<pubDate>Fri, 25 Mar 2011 13:59:30 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[connection speed]]></category>
		<category><![CDATA[google analytics]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=45</guid>
		<description><![CDATA[In a post on Wednesday, Trevor Claibourne of the Google Analytics Team announced that connection speed tracking will be removed from the Google Analytics product. This could be seen as a surprising move considering Google&#8217;s views on website speed, but is it? Claibourne assures those that use the Connection Speed reports &#8220;to understand the effect [...]]]></description>
			<content:encoded><![CDATA[<p>In a post on Wednesday, Trevor Claibourne of the Google Analytics Team announced that <a href="http://analytics.blogspot.com/2011/03/fond-farewell-to-connection-speed.html" title="A fond farewell to Connection Speed">connection speed tracking will be removed from the Google Analytics product</a>.</p>
<p>This could be seen as a surprising move considering <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html" title="Using site speed in web search ranking">Google&#8217;s views on website speed</a>, but is it?</p>
<p>Claibourne assures those that use the Connection Speed reports &#8220;to understand the effect of page load time and latency&#8221; that they&#8217;re working on an alternative solution. But have people been able to glean any useful information from these reports?</p>
<p>Profiling visitors on connection speed does nothing to improve the speed of a website. We actually believe the opposite to be true. Consider a report that shows 80% of a sites&#8217; visitors are on high-speed connections &#8211; does a designer take the decision to include a fancy graphic as 80% will be largely unaffected? Most likely yes, but this is flawed reasoning.</p>
<p>The crux of any design element &#8211; especially when there is a performance overhead &#8211; is whether or not it is necessary. If the graphic is necessary then it belongs there &#8211; if it&#8217;s not, remove it. If it is necessary, what&#8217;s the level of quality required? If an image looks fine at JPEG60 then you wouldn&#8217;t host it at JPEG100, regardless of how many visitors are on high-speed connections.</p>
<p>Reports like this go against the ideas of website optimization &#8211; they encourage those whose visitors are on fast connections to abuse those connections by adding unnecessary content to their sites. A site should never be slower that it needs to be, whatever your audience, and all this report has ever done is detail that audience.</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/google-analytics-deprecates-connection-speed/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Twig Templates</title>
		<link>http://retrofit9.com/blog/2011/wordpress-twig-templates</link>
		<comments>http://retrofit9.com/blog/2011/wordpress-twig-templates#comments</comments>
		<pubDate>Fri, 25 Mar 2011 12:32:21 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[templating]]></category>
		<category><![CDATA[twig]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=27</guid>
		<description><![CDATA[WordPress 3 did a lot to turn it from a blogging platform into a proper CMS and version 3.1 builds on this further with the introduction of post formats. Version 3 also saw the introduction of a new default theme, TwentyTen. The default theme has become bloated, has a complex &#8220;parts&#8221; system for includes, calls [...]]]></description>
			<content:encoded><![CDATA[<p><a title="WordPress 3.0 Features List" href="http://codex.wordpress.org/Version_3.0">WordPress 3</a> did a lot to turn it from a blogging platform into a proper CMS and version 3.1 builds on this further with the introduction of <a title="WordPress 3.1 Post Formats" href="http://codex.wordpress.org/Post_Formats">post formats</a>. Version 3 also saw the introduction of a new default theme, TwentyTen. The default theme has become bloated, has a complex &#8220;parts&#8221; system for includes, calls headers and footers separately &#8211; overall, it involves too much PHP, too much of <em>the model</em>.</p>
<p>Most frameworks have a templating system that simplifies theme design and obscures as much of the PHP code as possible. WordPress has no such system in place, so we&#8217;ve started to develop one for it. We&#8217;ve used the <a title="Twig Project Homepage" href="http://www.twig-project.org/">Twig templating system</a>, a powerful system with a straightforward syntax.</p>
<p>We&#8217;ve started to expose the various parts of the WordPress system through the use of objects and arrays, allowing familiar control structures to be used in themes rather that WordPress&#8217; own system of functions and conditionals. Here&#8217;s a simple WordPress loop to run through some posts, echoing links and titles, using the existing WordPress templating:</p>
<pre>
&lt;?php if(have_posts()): while(have_posts()): the_post() ;?&gt;
    &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;&lt;/a&gt;
    &lt;p&gt;&lt;?php the_excerpt(); ?&gt;&lt;/p&gt;
&lt;?php endwhile; endif; ?&gt;
</pre>
<p>Here&#8217;s the same loop using Twig templates from within WordPress themes:</p>
<pre>
{% for post in posts %}
    &lt;a href="{{ post.permalink }}"&gt;&lt;h2&gt;{{ post.title }}&lt;/h2&gt;&lt;/a&gt;
    &lt;p&gt;{{ post.excerpt }}&lt;/p&gt;
{% endfor %}
</pre>
<p>Looks a lot simpler doesn&#8217;t it? It is. Twig has a huge feature set that can be used in templating, with well though out control structures. See <a href="http://www.twig-project.org/doc/templates.html" title="Twig Documentation">Twig for Designers</a> for a no-nonsense rundown of what it can do.</p>
<p>We&#8217;ve recreated most of the WordPress TwentyTen theme using Twig, which is <a href="https://github.com/acleon/Twig-for-WordPress" title="Twig for WordPresson Repository">available on GitHub</a>. It&#8217;s in it&#8217;s early stages and there&#8217;s still quite some work to do, but it&#8217;s certainly interesting code to look at. We&#8217;ve also got an <a href="https://github.com/acleon/Twig-for-WordPress/wiki" title="Twig for WordPress Object Documentation">object reference for WordPress templates</a> up on the GitHub wiki to guide you if you are having a play.</p>
<p>Feel free to get in touch <a href="http://www.twitter.com/acleon">via Twitter @acleon</a> with any questions or suggestions.</p>
<p><a href="https://github.com/acleon/Twig-for-WordPress" title="Twig for WordPress on GitHub">Download Twig for WordPress from GitHub</a></p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/wordpress-twig-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CDNs (Content Delivery Networks)</title>
		<link>http://retrofit9.com/blog/2011/cdn-content-delivery-network</link>
		<comments>http://retrofit9.com/blog/2011/cdn-content-delivery-network#comments</comments>
		<pubDate>Sun, 13 Mar 2011 17:25:14 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Definitions]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=15</guid>
		<description><![CDATA[CDN stands for Content Delivery Network. It&#8217;s a method of delivering content to your users by hosting it on multiple servers positioned around the globe. Visitors get faster access to content and resources as they are directed to a server that is geographically close to them. A CDN can be run in-house but more often [...]]]></description>
			<content:encoded><![CDATA[<p>CDN stands for Content Delivery Network. It&#8217;s a method of delivering content to your users by hosting it on multiple servers positioned around the globe. Visitors get faster access to content and resources as they are directed to a server that is geographically close to them.</p>
<p>A CDN can be run in-house but more often it is handled by a large third-party hosting company. Good examples of CDN providers are Amazon or Edgecast. The disadvantage of CDNs is one of latency as content takes time to spread across the network. Without proper application design that takes this into consideration users can be requesting content that is not yet downloadable in their region</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/cdn-content-delivery-network/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Indexes</title>
		<link>http://retrofit9.com/blog/2011/database-indexes</link>
		<comments>http://retrofit9.com/blog/2011/database-indexes#comments</comments>
		<pubDate>Sun, 13 Mar 2011 17:24:08 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Definitions]]></category>
		<category><![CDATA[databases]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=13</guid>
		<description><![CDATA[An index on a database table is similar to an index in a book in that it help the database finds or sort rows on a particular column quickly. Queries run faster if they are searching or sorting on a column that is indexed than if the column were not indexed. It would however be [...]]]></description>
			<content:encoded><![CDATA[<p>An index on a database table is similar to an index in a book in that it help the database finds or sort rows on a particular column quickly. Queries run faster if they are searching or sorting on a column that is indexed than if the column were not indexed.</p>
<p>It would however be inefficient to index all the columns in a table as this would slow down the write speed. Every time a new row is created, or an existing one altered, the database server wold have to update the table as well as all the indexes. Usually only the columns most used in queries are indexed.</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/database-indexes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharding</title>
		<link>http://retrofit9.com/blog/2011/sharding</link>
		<comments>http://retrofit9.com/blog/2011/sharding#comments</comments>
		<pubDate>Sun, 13 Mar 2011 17:22:24 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Definitions]]></category>
		<category><![CDATA[databases]]></category>

		<guid isPermaLink="false">http://retrofit9.com/?p=8</guid>
		<description><![CDATA[Sharding is a load management technique used to split databases across multiple servers. Most sharding works on the primary key or some other index being modulus with the number of shards in order to decide where o tore that information. For example, the primary key may be 7 and there may be three shards. 7 [...]]]></description>
			<content:encoded><![CDATA[<p>Sharding is a load management technique used to split databases across multiple servers. Most sharding works on the primary key or some other index being modulus with the number of shards in order to decide where o tore that information.</p>
<p>For example, the primary key may be 7 and there may be three shards. 7 % 3 = 1 (when seven is divided by three there is a remainder of one?) so this record would be stored on the first shard.</p>
<p>Sharding can boost performance dramatically but is heavily disadvantaged when writing complex queries as these may need to have aggregate results from multiple servers. Applications should be designed so that they shard across dimensions that don&#8217;t usual mix (e.g. Users of an e-mail system).</p>
]]></content:encoded>
			<wfw:commentRss>http://retrofit9.com/blog/2011/sharding/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

