<?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>Justin Frydman - Web developer/designer from Canada &#187; browser cache</title>
	<atom:link href="http://defunctlife.com/tag/browser-cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://defunctlife.com</link>
	<description>Web development, design, travel and language learning.</description>
	<lastBuildDate>Mon, 14 Feb 2011 22:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Slow Speeds and Speeding up Concrete5 5.4</title>
		<link>http://defunctlife.com/2010/05/slow-speeds-and-speeding-up-concrete5-5-4/</link>
		<comments>http://defunctlife.com/2010/05/slow-speeds-and-speeding-up-concrete5-5-4/#comments</comments>
		<pubDate>Tue, 11 May 2010 14:46:25 +0000</pubDate>
		<dc:creator>defunct</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[browser cache]]></category>
		<category><![CDATA[concrete5]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://defunctlife.com/?p=140</guid>
		<description><![CDATA[*UPDATE: Read the comments, the server hard drive was dying and that is the reason why files were never being cached. However these methods will still help speed your concrete5 website up.* If you&#8217;re using the new Concrete5 5.4.x package you may have noticed your website has slowed down  from previous versions. After doing some [...]]]></description>
			<content:encoded><![CDATA[<p><strong>*UPDATE: Read the comments, the server hard drive was dying and that is the reason why files were never being cached. However these methods will still help speed your concrete5 website up.*</strong></p>
<p>If you&#8217;re using the new Concrete5 5.4.x package you may have noticed your website has slowed down  from previous versions. After doing some NET tests with <a href="http://getfirebug.com/">Firebug</a> we can see where the bottleneck presents itself.</p>
<div id="attachment_142" class="wp-caption aligncenter" style="width: 310px"><a href="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5.jpg"><img class="size-medium wp-image-142 " title="Default Concrete5 5.4 Speeds" src="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5-300x73.jpg" alt="Default Concrete5 5.4 Speeds" width="300" height="73" /></a><p class="wp-caption-text">Default Concrete5 5.4 Speeds</p></div>
<p>After examining the chart you can see that loading Concrete5&#8242;s jquery takes up the most time per page, at over 1 second in this case.  Under normal circumstances we could live with this as it will get cached next load, let&#8217;s click on the page again:</p>
<div id="attachment_143" class="wp-caption aligncenter" style="width: 310px"><a href="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_2.jpg"><img class="size-medium wp-image-143 " title="Cached load of Concrete5 5.4" src="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_2-300x25.jpg" alt="Cached load of Concrete5 5.4" width="300" height="25" /></a><p class="wp-caption-text">Cached load of Concrete5 5.4</p></div>
<p>As we can see, <em><strong>ccm.base.css</strong></em><em>, <strong>jquery.js</strong></em><em> </em>and<em> <strong>ccm.base.js</strong></em><em> </em>are being loaded every single time a page load is executed. These files seems to load insanely slow, especially the extra second it takes to load jquery. <a href="http://www.concrete5.org/help/building_with_concrete5/developers/tuning-and-performance/5-easy-ways-to-speed-up-a-concrete5-site/">My theme is currently not editable</a>, which slows down your site even more, causing more CSS files to be loaded every page load. The CSS files being loaded in this example are only needed when you are logged in editing pages and do not need to be loaded on the front-end.</p>
<p>Your tests may very depending your <strong>server setup, location from server and of course your template itself</strong>, but in the end this may be overhead you don&#8217;t need, so let&#8217;s speed up concrete5 page loading.</p>
<p>If you do not need jquery at all you can follow <a href="http://www.concrete5.org/help/building_with_concrete5/developers/tuning-and-performance/5-easy-ways-to-speed-up-a-concrete5-site/">this guide</a> on the Concrete5 website. This will stop jquery and all the non needed CSS files from loading in your front-end giving your website a snappy boost. If you <strong>do need jquery</strong>, I recommend loading it directly from google&#8217;s servers. This can speed up performance significantly and allows for actual file caching.</p>
<p>1. Copy concrete/elements/header_required.php into your local elements/ directory.<br />
2. Open the file and find these lines:</p>
<blockquote><p>$this-&gt;addHeaderItem($html-&gt;css(&#8216;ccm.base.css&#8217;), &#8216;CORE&#8217;);<br />
$this-&gt;addHeaderItem($html-&gt;javascript(&#8216;jquery.js&#8217;), &#8216;CORE&#8217;);<br />
$this-&gt;addHeaderItem($html-&gt;javascript(&#8216;ccm.base.js&#8217;), &#8216;CORE&#8217;);</p></blockquote>
<p>3. Replace them with the following, <a href="http://www.dynamicdrive.com/forums/blog.php?b=11">loading jquery direct from Google&#8217;s servers and not using their API for better performance</a> &#8211;  (cut and paste from <a href="http://pastie.org/1437404">here</a>):</p>
<blockquote><p>if ($u-&gt;isRegistered()) {<br />
$this-&gt;addHeaderItem($html-&gt;css(&#8216;ccm.base.css&#8217;), &#8216;CORE&#8217;);<br />
$this-&gt;addHeaderItem($html-&gt;javascript(&#8216;jquery.js&#8217;), &#8216;CORE&#8217;);<br />
$this-&gt;addHeaderItem($html-&gt;javascript(&#8216;ccm.base.js&#8217;), &#8216;CORE&#8217;);<br />
} else {<br />
echo &#8216;&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&#8221;&gt;&lt;/script&gt;&#8217;;<br />
}</p></blockquote>
<h2>Results of our modifications</h2>
<div id="attachment_146" class="wp-caption aligncenter" style="width: 310px"><a href="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_3.jpg"><img class="size-medium wp-image-146 " title="Non-cached load after Concrete5 modifications" src="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_3-300x67.jpg" alt="Non-cached load after Concrete5 modifications" width="300" height="67" /></a><p class="wp-caption-text">Non-cached load after Concrete5 modifications</p></div>
<p>Already we have taken our page load down a bit from <em>2.68 seconds </em> to <em>2.41 seconds. </em>Compare Concrete5&#8242;s <em>1.16 second </em>jquery loading to Google&#8217;s <em>91 millisecond</em> time. A significant difference. Now let&#8217;s compare a cached page load.</p>
<div id="attachment_149" class="wp-caption aligncenter" style="width: 310px"><a href="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_4.jpg"><img class="size-medium wp-image-149 " title="Cached page load after Concrete5 modifications" src="http://defunctlife.com/wp-content/uploads/2010/05/fb_concrete5_4-300x17.jpg" alt="Cached page load after Concrete5 modifications" width="300" height="17" /></a><p class="wp-caption-text">Cached page load after Concrete5 modifications</p></div>
<p>At last, a full page cache! Compare this from our previous cache test of <em>1.55 seconds </em>to our new <em>619 milliseconds!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://defunctlife.com/2010/05/slow-speeds-and-speeding-up-concrete5-5-4/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

