<?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>Swedish fika &#187; Web Performance</title>
	<atom:link href="http://www.swedishfika.com/category/web-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swedishfika.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 25 Nov 2011 21:56:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Basic and Sometimes Forgotten Tips on How to Speed Things Up</title>
		<link>http://www.swedishfika.com/2009/01/24/basic-and-sometimes-forgotten-tips-on-how-to-speed-things-up/</link>
		<comments>http://www.swedishfika.com/2009/01/24/basic-and-sometimes-forgotten-tips-on-how-to-speed-things-up/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 13:09:24 +0000</pubDate>
		<dc:creator>Ida</dc:creator>
				<category><![CDATA[Web Performance]]></category>

		<guid isPermaLink="false">http://swedishfika.com/?p=140</guid>
		<description><![CDATA[In this article about making your web site faster I will commit to the sinful act of “throwing around beavers inside the log house” (old swedish saying). Clearly speaking; some of those tips are not implemented on this page for various reasons. That does NOT mean that these tips are hideously bad or that you [...]]]></description>
			<content:encoded><![CDATA[<p>In this article about making your web site faster I will commit to the sinful act of “throwing around beavers inside the log house” (old swedish saying). Clearly speaking; some of those tips are not implemented on this page for various reasons. That does NOT mean that these tips are hideously bad or that you shouldn’t try them out yourself. Ok? Good! Let’s get started:</p>
<p><span id="more-140"></span></p>
<h3>1. Use the right file-format for your images</h3>
<p>Put some thought into whether the best format to go with is jpg, gif or maybe a png?<br />
Don’t sigh! A lot of people think they are really good at this and never really think it through. I don’t mean to insult you but you might be one of them. If so don’t be too sad. You are in good company with Google! Yay!<br />
 <a href="http://graphicsoptimization.com/blog/?p=68">Read this article about Google and image optimizing.</a> And yes, Google did learn their lesson. </p>
<p><strong>Why?</strong><br />
Because it will reduce the size and a lot of times also increase the visual appearance of your amazing images. Your page will finish up extra-awesome.</p>
<p><strong>Why not?</strong><br />
Because you are a lazy bastard! Sorry I’m just joking. Acually there are times when you should go against what seems to be a good idea. Especially when chosing between a png and a gif-format. That is when dear Internet Explorer turns into a grumpy kid and refuse to cooperate.</p>
<p><strong>Any links?</strong><br />
<a href="http://smushit.com/">Check out Smush.it </a></p>
<h3>2. Sprites</h3>
<p>Did you know that every single image on your page needs their own connection to load? In some web browsers (Opera)  you can see nice data like “4/653 elements” have loaded. Wouldn’t it be nice if you could cut back that 653&hellip; a lot? If yes, then sprites is the thing for you.</p>
<p><img src="http://swedishfika.com/wp-content/uploads/speed-2009-01-24-sprite.gif" alt="Menu made into sprite" /></p>
<p><strong>Why?</strong><br />
The concept of sprites means that you have one image which contains a lot of smaller images. Then you use css to show the right one. I recently converted our menu into a sprite. It reduced the amount of connections from eight down to one and the size were reduced with fifty percent. (Yes! One beaver less!)</p>
<p><strong>Why not?</strong><br />
If you only have very large images on your site. Don’t make a super-picture just to get one connection because that probably means that the poor guy visiting have to be equipped with extreme amounts of patience.<br />
Also if you constantly change the images and moreover they all have different width and height then sprite is still good but it can be a real pain to update.</p>
<p><strong>Any links?</strong><br />
<a href="http://www.alistapart.com/articles/sprites/">A List Apart: Image Slicing’s Kiss of Death</a> This is a good one!<br />
<a href="http://spritegen.website-performance.org/">You might also try out this CSS sprite generator</a> if you are a lazy&hellip; sorry. I mean try it.</p>
<h3>3. Check your css</h3>
<p>So we’re done with images let’s move on to styles. Css-files are not as annoying as images when it comes to slowing down your page. But if you are running a pretty large page it’s definitely worth it. The best reason, which any geek would buy, is the sweet feeling of knowing that everything in your css is perfect. No color and background-images applied to nonexistent elements that you erased several years ago.</p>
<p><strong>Why? </strong><br />
Minimize the size of your css-files is a good thing not only because the size of your page will go down but moreover you will give your css an extra thought and maybe when you want to do some redesign in the far future you won’t run into problem because of stupid old and rotting styles.</p>
<p><strong>Why not?</strong><br />
Because you simply don’t have time. This can be really time-consuming. Other reasons could be that your css-file is not that big in size and/or your page is pretty small with low traffic.</p>
<p><strong>Any links?</strong><br />
Yes! There is a great tool to help you out. It&#8217;s called <a href="http://services.immike.net/css-checker/">CSS Redundancy Checker.</a> (Sorry people, but there goes the time-consuming excuse..)</p>
<h3>4. Compress your css and your &#8216;beloved&#8217; JavaScript</h3>
<p>Now we have moved on to the evil monster of slowing down pages. JavaScript. Boooh!  Don’t get mad now all you people who have a long a prosperious marriage with jQuery. I don’t say you should stop using JavaScript. I just want to point out that things can be improved. I wrote the word &#8220;beloved&#8221; for a reason. Do not overuse JavaScript!<br />
Go through all your scripts and keep the ones that truly add something of value. Throw the rest in the trash.<br />
After that start compressing! And do the same with the css.</p>
<p><strong>Why?</strong><br />
Easy. Compressed means smaller files which means a faster web site. Another great(?) benefit is that compressed code makes it a lot harder for people to figure out how you did things.</p>
<p><strong>Why not?</strong><br />
Because you want your code to be readable. This is actually a good reason to not compress your code. As for me I hate stumbling over some great JavaScript-functionality only to check behind the curtain  and discover that the script is totally compressed and ugly. A lot of people learn by trying out cool things they&#8217;ve seen on other pages. A compressed file makes it, if not impossible but very hard to learn by copying. So don’t be an egoistic prick! Share the great stuff! (Compress the dull things&hellip;)</p>
<p><img src="http://swedishfika.com/wp-content/uploads/speed-2009-01-24-yui-compre.gif" alt="YUI Compressor" /></p>
<p><strong>Any links?</strong><br />
<a href="http://developer.yahoo.com/yui/compressor/">Yahoo! UI Library: YUI Compressor</a> there are also <a href="http://yui.2clics.net/">an online version</a> that might come in handy if you don&#8217;t like to install things.<br />
Of course you can compress your css with the YUI compressor but there are also specific online tools for css. <a href="http://www.cleancss.com/">Clean CSS</a> and <a href="http://iceyboard.no-ip.org/projects/css_compressor">CSS Compressor</a> to name a few.</p>
<h3>5. Avoid JavaScript-errors</h3>
<p>Have anyone been browsing in Firefox with a cool little plugin called Firebug turned on? And then suddenly you happened to end up on this evil site (i.e. famous swedish newspaper) and your friend, the tiny Firebug, starts screaming in agony and ten seconds later you are incapable of moving (the mouse). Sounds familiar?<br />
If you realize that your page is full of JavaScript errors you need to do something! You need to stop browser-slavery! Don’t make your web browser do unnecessary work! Check if stuff actually can be done before trying to do it. Something as simple as the code below could be a great improvement.</p>
<p><code><br />
if(getElementById('#superCoolElement')) {<br />
// Do cool stuff with cool element!<br />
}<br />
</code></p>
<p><strong>Why?</strong><br />
If your browser is constantly trying to do something that cannot be done it’s not good and it will slow down your page. This is pretty obvious. So go through your code. And if possible don’t include all JavaScripts on every page just because it’s an easy way to go. It might not be such a good idea.</p>
<p><strong>Why not?</strong><br />
Because you hate browsers, people who visit your page and the internet in general…<br />
Actually I can’t really find a good reason why you should not do this.</p>
<p><strong>Any links?</strong><br />
You might enjoy <a href="http://www.informit.com/library/content.aspx?b=STY_JavaScript_24_hours&amp;seqNum=177">this article on Avoiding Bugs from InformIT</a> and also <a href="http://www.devhands.com/2008/10/javascript-error-handling-and-general-best-practices/">this slide about JavaScript error handling</a></p>
<p>That&#8217;s all for now people!<br />
Have a great weekend!<br />
/Ida</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swedishfika.com/2009/01/24/basic-and-sometimes-forgotten-tips-on-how-to-speed-things-up/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

