<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Keefe Tang</title> <link>http://tang.waik.it</link> <description /> <lastBuildDate>Thu, 10 Jun 2010 12:16:27 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/keefetang" /><feedburner:info uri="keefetang" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>The Future Of Web Design</title><link>http://feedproxy.google.com/~r/keefetang/~3/NA1saWM-K_Q/</link> <comments>http://tang.waik.it/the-future-of-web-design/#comments</comments> <pubDate>Mon, 10 May 2010 06:15:01 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=15</guid> <description><![CDATA[The­re has been quite a discussi­on go­ing on af­ter Mike David&#173;son’s re­marks on how peop­le pre&#173;fer the much sim­pler, mobile versi­on of a si­te.First, how much bet­ter so­me compa&#173;nies’ iPhone apps are than their web si­tes, as if the compa&#173;ny is somehow so much more gifted at cre&#173;ating iPhone apps than web pages.The compa&#173;nies are [...]]]></description> <content:encoded><![CDATA[<p>The­re has been quite a discussi­on go­ing on af­ter Mike David&shy;son’s re­marks on how peop­le pre&shy;fer the much sim­pler, mobile versi­on of a si­te.</p><blockquote><p>First, how much bet­ter so­me compa&shy;nies’ iPhone apps are than their web si­tes, as if the compa&shy;ny is somehow so much more gifted at cre&shy;ating iPhone apps than web pages.</p></blockquote><p>The compa&shy;nies are not more gifted in de­si­g­ning for a smal­ler screen but rather the tiny screen has forced them to show only the most important in­formati­on and cast away the un­important and use&shy;less in­formati­on—the con­tent its­elf—leav&shy;ing only the con­t­ents wi­th less or no dis­tracti­ons.</p><p>It might be arrogant of me to pre&shy;dict the fu&shy;ture of the web wi­th virtually no data to support my view but I see the fu&shy;ture of the web—or at least I hope it will—to beco­me a place whe­re con­tent webs­i­tes will give emphasis to con­tent. As silly as it alre­ady sounds re­ading what I just wrote, today’s webs­i­tes are dictated by adver&shy;tise&shy;ments whe­re they spam you wi­th end&shy;less, annoying ads. To make sure that they are able to bombard you wi­th as many ad im­pressi­on as pos&shy;si­ble, they make a seem&shy;ingly simple task 2 to 3 times har­der to do.</p><p>What I’m sugge­st&shy;ing isn’t that the fu&shy;ture of webs­i­tes would look li­ke the many mobile coun­terpart of their webs­i­te, but rather a much focused and clean in­terface wi­th just one quality adver&shy;tise&shy;ment. One adver&shy;tise&shy;ments might seem too lit&shy;tle but the adver&shy;tise&shy;ment will get 100% at&shy;tenti­on from the view­ers rather than bombard&shy;ing them wi­th 3 or 4 sec&shy;ond grade quality ads that one and only spot can be sold at a much high&shy;er pri­ce. Wi­th less ad dis­tracti­on, the amount of visi­tors will only con&shy;tinue to incre­ase which in turn can bring up the pri­ce of that sing­le ad spot.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/NA1saWM-K_Q" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/the-future-of-web-design/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/the-future-of-web-design/</feedburner:origLink></item> <item><title>Dropping Blog Comments</title><link>http://feedproxy.google.com/~r/keefetang/~3/ydHkf32z8Ms/</link> <comments>http://tang.waik.it/dropping-blog-comments/#comments</comments> <pubDate>Fri, 08 Jan 2010 14:00:39 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=5</guid> <description><![CDATA[As some of you might know, this site has no com&#173;ment system. Many people wonder why I disable it when Word&#173;press has a great com&#173;ment system—all I need to do is just style it—ready to be use. No More House&#173;keeping As Kroc Camen puts it “Public com&#173;ment threads just encour&#173;age people to write a lot [...]]]></description> <content:encoded><![CDATA[<p> As some of you might know, this site has no <a href="/v2/#comment">com&shy;ment system</a>. Many people wonder why I disable it when <a href="http://wordpress.org/">Word&shy;press</a> has a great com&shy;ment system—all I need to do is just style it—ready to be use.</p><h2 id="housekeep">No More House&shy;keeping</h2><p> As Kroc Camen <a href="http://camendesign.com/blog/hello#hello-iii">puts</a> it <q>“Public com&shy;ment threads just encour&shy;age people to write a lot of words, and say noth&shy;ing.”</q>, and I do agree with that. When it comes to blog com&shy;ments on the web, most of them are use&shy;less. There are too many com&shy;ments like <q>“Great post, keep up the work!”</q> <span class="amp">&#038;</span> <q>“This is a stupid post”</q> that does noth&shy;ing but clutter up the com&shy;ment thread.</p><p> Some say having a community in&shy;spires debate, but what I mainly observe is through the power of Inter&shy;net anonymity, it mostly in&shy;spires hit-and-run com&shy;ments. Unintelligent, sense&shy;less spams that in the end requires the site owner to do reg&shy;ular house&shy;keeping is a waste of time. Wast&shy;ing time of the site owner where he or she could use that time to write a quality article.</p><h2 id="inspire">It In&shy;spires Debate</h2><p> Quality rebuttals, the ones that results in quality exchange of ideas. It is one thing to post meaning&shy;less com&shy;ment on some&shy;one’s blog, it is an&shy;oth&shy;er when you argue your points with your readers watch&shy;ing. When oth&shy;er people are looking you, its hard&shy;er to make a fool of your&shy;self. Who doesn’t care of their own rep&shy;u&shy;tation, especially those who have many readers fol&shy;lowing and judging ev&shy;ery&shy;thing you type.</p><p> One example of this is when Kroc Camen <a href="http://camendesign.com/big_on_type">linked</a> one of my <a href="/big-on-type/">post</a>. His com&shy;ments was constructive, leav&shy;ing me reflecting on some of the poor choic&shy;es I made. It is no shame in be&shy;ing told you are wrong, in fact I would ap&shy;preciate it more when people points out what I’ve done wrong. How else can one be right with&shy;out be&shy;ing wrong?</p><h2 id="show">Show What You Want To Show</h2><p> Take this site for example, this website be&shy;longs to me, it is written for people that wants to read my site. When my vis&shy;itors vis&shy;its my site, I expect them to read what I write. What I written has always been what I could to my best ability and I want my vis&shy;itors to see what I want them to see.</p><p> That can nev&shy;er hap&shy;pen when the blog is bloated with com&shy;ments. With the addition of com&shy;ments, vis&shy;itors that read the blog will need to skim through the con&shy;tent and decide which con&shy;tent is worth the look and which isn’t. That is noth&shy;ing like what I imag&shy;ine the vis&shy;itors will need to behave when they come to this site.</p><h2 id="what">What Then?</h2><p> I am not here to suggest an al&shy;ternative but people have been explor&shy;ing differ&shy;ent ways to bring the discus&shy;sion elsewhere, be it with twitter or fo&shy;rums. They all have their strengths and weak&shy;nesses.</p><p> As for me I pre&shy;fer the good old fash&shy;ion <a href="mailto:contact@yun4.net">email</a>. It is been around longer than I have and it has served the people on the web quite well. Those who absolutely must get their com&shy;ments out of their chest can <a href="mailto:contact@yun4.net">email</a> me. Those who just want to say hi can <a href="mailto:contact@yun4.net">email</a> me. Those who wants to inform me of their rebuttal can <a href="mailto:contact@yun4.net">email</a> me.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/ydHkf32z8Ms" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/dropping-blog-comments/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/dropping-blog-comments/</feedburner:origLink></item> <item><title>BIG On Type</title><link>http://feedproxy.google.com/~r/keefetang/~3/1iKhkyBxnBk/</link> <comments>http://tang.waik.it/big-on-type/#comments</comments> <pubDate>Fri, 11 Dec 2009 14:00:42 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=1</guid> <description><![CDATA[Many of you may wonder what is the deal with the big font size on my website. The font size is re&#173;ally not at all as big as you thought it is. We only think it is big because we are surrounded by website with freak&#173;ishly small font size. Take DaringFireball for example, the font [...]]]></description> <content:encoded><![CDATA[<p> Many of you may wonder what is the deal with the big font size on my website. The font size is re&shy;ally not at all as big as you thought it is. We only think it is big because we are surrounded by website with freak&shy;ishly small font size.</p><p> Take <a href="http://daringfireball.net/">DaringFireball</a> for example, the font size set on this website is 11<abbr>px</abbr>, that is extremely diffi&shy;cult to read comfort&shy;ably with&shy;out plac&shy;ing your face near your screen. Even it’s lev&shy;el 1 heading is sized at 1.55em, that is 17.05<abbr>px</abbr> just about a pixel big&shy;ger than the default font size.</p><h2 id="notbig">It’s Not Big</h2><p> When talked about 16<abbr>px</abbr> font size we im&shy;me&shy;diately say big font or large type. The fact is it is not big or large, it is the <em>default</em> size. Website us&shy;ing font size small&shy;er than 16<abbr>px</abbr> are the ones we should be call&shy;ing small and yet 11<abbr>px</abbr> <span class="amp">&#038;</span> 12<abbr>px</abbr> font size have dom&shy;inate the mar&shy;ket so such a long time it has been perceived as the default size by the viewers. Be&shy;ing presented with the default font size now seem to be huge and odd.</p><p> The default font size is not odd, in fact, when you look at it again for a few times it almost seems right. The question then becomes “why isn’t most website us&shy;ing the default font size?”.</p><p> To under&shy;stand it we have to look at the old age. The time where com&shy;put&shy;ers are starting to gain public recog&shy;nition, as a tool that can use at home to simplify our life. A time where the Inter&shy;net is boom&shy;ing. A time where displays are still rel&shy;atively expensive and most website are faced with a prob&shy;lem. The displays have low res&shy;olution.</p><p> Us&shy;ing the default size means that information is hard to display as 800×600 can’t display that many lines of words on the screen so we use a small&shy;er font to get the message across. Us&shy;ing a small&shy;er font size makes sense back then but somehow web designers nev&shy;er kept up with the display changes. We are no longer confined by 800×600, I don’t even have vis&shy;itors view&shy;ing this website with 800×600 res&shy;olution. We find so much space in design and there are so many empty spaces on both sides and I don’t think anyone wants to fill them with 12<abbr>px</abbr> Hel&shy;vet&shy;ica.</p><h2 id="small">It&#8217;s Small</h2><p> Phys&shy;ically 16<abbr>px</abbr> is about as big as 12<abbr>pt</abbr> in print. That is not at all big, most print ma&shy;te&shy;rial are print with this size. Add to that is that we normally read from a dis&shy;tance much fur&shy;ther than we do with print ma&shy;te&shy;rial, the impact is signif&shy;icant.</p><p> The saying <a href="http://informationarchitects.jp/the-web-is-all-about-typography-period/">95% of web design is typog&shy;raphy</a> should be fa&shy;mil&shy;iar to web designers—if it isn’t I suggest you don’t call your&shy;self one to save your&shy;self from embarrass&shy;ment—then what is more important than to design your website to be eas&shy;ily read with&shy;out print&shy;ing your face onto the screen ev&shy;ery time you need to read—I be&shy;lieve we have enough young chil&shy;dren wearing glasses.</p><p> There is no rea&shy;son at at all to squeeze that much information into the screen, in fact it is even rec&shy;ommended by <a href="http://www.w3.org/QA/Tips/font-size"><abbr>w3c</abbr></a>. Having a font size big&shy;ger or equiva&shy;lent to 16<abbr>px</abbr> could also be <a href="http://www.lighthouse.org/accessibility/top-10/">ben&shy;e&shy;ficial</a> to busi&shy;nesses as well.</p><blockquote><p> The prob&shy;lem here is a ba&shy;sic us&shy;ability and ac&shy;cessibility issue: a good design should look good with&shy;out requiring the us&shy;er to enlarge or reduce the text size.</p></blockquote><h2 id="join">Join Now</h2><p>Change is hard. Why ven&shy;ture into the un&shy;known when we are comfort&shy;able just the way we are?</p><p> We people are always resistant to change, a study howev&shy;er have found that happi&shy;ness can lift the mood of a per&shy;son’s ex&shy;tended network of friends and that very same support can influ&shy;ence change in some&shy;one. People are better able to change when people in their social network are chang&shy;ing as well.</p><blockquote><p> People are more likely to make pos&shy;itive changes in their lives not only when their friends do, but when their friends of friends do, and when their friends of friends of friends do.</p></blockquote><p>All it takes is just to de&shy;fine the font size with <code>font-size:100%;</code>.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/1iKhkyBxnBk" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/big-on-type/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://tang.waik.it/big-on-type/</feedburner:origLink></item> <item><title>Minimal Design</title><link>http://feedproxy.google.com/~r/keefetang/~3/ZoKXKl02PFo/</link> <comments>http://tang.waik.it/minimal-design/#comments</comments> <pubDate>Sun, 06 Dec 2009 14:00:22 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=9</guid> <description><![CDATA[The word design have a very scat&#173;tered applications—as a verb, a noun and an adjective—many of us does not seem to fully grasp the goal of design. Design plays a crucial role in communicating message to the au&#173;di&#173;ence. A great design will generate inter&#173;est thus encour&#173;aging the au&#173;di&#173;ence to exam&#173;ine the con&#173;tent of your message. [...]]]></description> <content:encoded><![CDATA[<p> The word design have a very scat&shy;tered applications—as a verb, a noun and an adjective—many of us does not seem to fully grasp the goal of design. Design plays a crucial role in communicating message to the au&shy;di&shy;ence. A great design will generate inter&shy;est thus encour&shy;aging the au&shy;di&shy;ence to exam&shy;ine the con&shy;tent of your message.</p><p> Web au&shy;di&shy;ence show a rel&shy;atively short at&shy;tention to posts and articles they find on the inter&shy;net due to the massive amount of information avail&shy;able. To go through ev&shy;ery article in detail would be too time consum&shy;ing, that is why the au&shy;di&shy;ence skim through, and yes, sometimes the good articles are mis&shy;sed.</p><p> The goal of minimal design is to strip away unnec&shy;essary design el&shy;e&shy;ments from your design, unnec&shy;essary design el&shy;e&shy;ments that will only confuse the au&shy;di&shy;ence rather than keeping them inter&shy;ested.</p><blockquote><p> You know you’ve achieved per&shy;fection in design, not when you have noth&shy;ing more to add, but when you have noth&shy;ing more to take away.</p><cite>antoine de saint-exupéry</cite></blockquote><p> The common mis&shy;conception about minimal design that it is used to focus the au&shy;di&shy;ence to the con&shy;tent of the website rather than the vi&shy;su&shy;al presentation of the design. That is simply not true at all. Minimal design, like all design principles is to compli&shy;ment and enhance it’s con&shy;tent rather than to shift the au&shy;di&shy;ence’s at&shy;tention to the con&shy;tent.</p><p> Once a good design catches the at&shy;tention of the au&shy;di&shy;ence, the au&shy;di&shy;ence will nat&shy;urally find inter&shy;est in exam&shy;ining your con&shy;tent. Minimal design merely does that more quickly than oth&shy;ers due to the na&shy;ture of the design.</p><p> Minimal design aims to de&shy;liv&shy;er a clear and di&shy;rect message across to your au&shy;di&shy;ence. Cramming all the information you can find will only make a bad im&shy;pres&shy;sion on the au&shy;di&shy;ence and very of&shy;ten the au&shy;di&shy;ence becomes uninter&shy;ested and leaves.</p><p> Design is all about simplifying our life, enabling us to accomplish tasks more ef&shy;fectively. If your prod&shy;uct does that, I don’t see why your au&shy;di&shy;ence will not trusts you and return for more.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/ZoKXKl02PFo" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/minimal-design/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/minimal-design/</feedburner:origLink></item> <item><title>Website Optimisation: Part 3</title><link>http://feedproxy.google.com/~r/keefetang/~3/BXi4owhi54U/</link> <comments>http://tang.waik.it/website-optimisation-part-3/#comments</comments> <pubDate>Mon, 16 Nov 2009 14:00:03 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=13</guid> <description><![CDATA[The first part of the web opti&#173;mi&#173;sa&#173;tion article discussed on produc&#173;ing clean html code while the sec&#173;ond part of the article focused on var&#173;ious opti&#173;mi&#173;sa&#173;tion out&#173;side the markup. The idea was simple, serve as lit&#173;tle as pos&#173;sible, as fast as pos&#173;sible. While we do our best to serve the files as fast as we can, [...]]]></description> <content:encoded><![CDATA[<p> The first part of the web opti&shy;mi&shy;sa&shy;tion article discussed on produc&shy;ing clean <abbr title="Hyper Text Markup Language">html</abbr> code while the sec&shy;ond part of the article focused on var&shy;ious opti&shy;mi&shy;sa&shy;tion out&shy;side the markup. The idea was simple, serve as lit&shy;tle as pos&shy;sible, as fast as pos&shy;sible.</p><p> While we do our best to serve the files as fast as we can, it still wouldn’t be faster than serving them from cache. Bare in mind that only viewers that have pre&shy;vi&shy;ously vis&shy;ited your site is able to save the files as cache in their com&shy;put&shy;ers and even for major websites like <a href="http://www.yahoo.com">Yahoo!</a>, <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/">40% – 60%</a> of their vis&shy;itors arrive at their site with an empty cache.</p><h2 id="cache">web cache</h2><p> The idea of web cache is to store frequently used objects clos&shy;er to the viewers through var&shy;ious means. By do&shy;ing so your viewers avoid round trips to the web serv&shy;er, saving bandwidth, serv&shy;er load and most importantly faster loading, much faster loading.</p><p> There are many ways that you can set cache con&shy;trol rules for your web site, the simplest way is through <abbr>html</abbr> <code>&lt;meta&gt;</code> tag, but like I <a href="/website-optimisation-part-1/#header">said</a> it produces ugly code and it is poorly support&shy;ed by brows&shy;er cache.</p><p> Cach&shy;ing does not concern your viewers and they certainly don’t need to see your rules for cach&shy;ing, the rules only concerns the browsers thus only the brows&shy;er should be informed on how you want to cache your files. Writing the cache rules in your <code>.htacess</code> file would be the best way to achieve that goal.</p><h2 id="method">caching methods</h2><dl><dt>Last-Modified</dt><dd><p> When a brows&shy;er sends its <abbr>http</abbr> request to a web serv&shy;er, the <abbr>http</abbr> response of the serv&shy;er could optionally include a <code>Last-Modified</code> <abbr>http</abbr> head&shy;er to tell the brows&shy;er when the file was last modi&shy;fied. The next time your vis&shy;itor reloads your page, their brows&shy;er will asks the web serv&shy;er if the file has changed since the brows&shy;er’s last request by including a <code>If-Modified-Since</code> <abbr>http</abbr> head&shy;er. If it is changed the brows&shy;er will download the newest file, if not the brows&shy;er will use the file in it’s cache.</p></dd><dt><abbr title="entity tag">etag</abbr></dt><dd><p> It works roughly the same as the <code>Last-Modified</code> <abbr>http</abbr> head&shy;er but in&shy;stead of telling the brows&shy;er when it is last modi&shy;fied it tags the file with a generated checksum val&shy;ue.</p><p> This is used because sometimes—but not very of&shy;ten, at least I hope it’s not—the serv&shy;er’s clock gets messed up, that would mean the cache is not accurate anymore. That is why <abbr>etag</abbr> is much more pre&shy;ferred, the key is unique, less likely to be messed up by errors like mis&shy;adjust time.</p><p> <abbr>etag</abbr> howev&shy;er is also plagued by it’s unique identi&shy;fi&shy;er, since the key is unique, sites that is hosted with mul&shy;ti&shy;ple serv&shy;er or us&shy;ing <abbr title="content delivery network">cdn</abbr> will not match <code><abbr>etag</abbr></code> generated from an&shy;oth&shy;er serv&shy;er, thus rendering it use&shy;less. It is rec&shy;ommended that <abbr>etag</abbr> be <a href="http://developer.yahoo.com/performance/rules.html#etags">removed</a> by the Yahoo! Exceptional Performance team.</p></dd><dt>Expires</dt><dd><p> While checking with the web serv&shy;er to see if a file has changed is better than getting the file it&shy;self, there is still a need to check ev&shy;ery time viewers reloads the page. This is when <code>Expires</code> <abbr>http</abbr> head&shy;er starts to look like a better al&shy;ternative to <abbr>etag</abbr> <span class="amp">&#038;</span> <code>Last-Modified</code>.</p><p> What <code>Expires</code> does is tell the brows&shy;er when it sends a file that the file can be used over and over again until a certain time. The brows&shy;er will use the cache ver&shy;sion of the file ev&shy;ery time your viewers reloads the page un&shy;less it expires.</p></dd></dl><h2 id="set">set it up</h2><p> The in&shy;struction is for Apache, if you are us&shy;ing <abbr title="Internet Information Server">iis</abbr> seek elsewhere for in&shy;struction on how to set it up. While you can write the exact cache con&shy;trol head&shy;er to all the files you want cached, I pre&shy;fer us&shy;ing <code>mod_expires</code> to spec&shy;ify the cache rule.</p><p> Before we proceed make sure your Apache serv&shy;er have <code>mod_expires</code> <span class="amp">&#038;</span> <code>mod_headers</code> in&shy;stalled and loaded.</p><h3 id="extension">cache files by exten&shy;sion</h3><p> This method tar&shy;gets files with the spec&shy;i&shy;fied exten&shy;sion, while that can be very simple to perform and under&shy;stand it has it’s own down&shy;side. For one it requires a file exten&shy;sion.</p><pre> 
  <code>&lt;FilesMatch "\.(html|htm)$"&gt;</code> 
  <code>  Expires A3600</code> 
  <code>&lt;/FilesMatch&gt;</code> 
</pre><p> The code above ba&shy;sically matches ev&shy;ery file with the exten&shy;sion <code>.html</code> or <code>.htm</code> and adds an expiry date, 3600 sec&shy;onds af&shy;ter access (A). To tar&shy;get oth&shy;er file exten&shy;sion just change the exten&shy;sion and modify the expiry date as you see fit.</p><h3 id="mime">cache files by <abbr title="Multipurpose Internet Mail Extensions">mime</abbr> type</h3><p> Tar&shy;geting the <abbr>mime</abbr> type is much accurate than file exten&shy;sion as the exten&shy;sion can be eas&shy;ily changed but this method requires you to remember setting the correct <abbr>mime</abbr> type. Changes like gzipping the file can change the file’s <abbr>mime</abbr> type and with&shy;out prop&shy;erly defining the <abbr>mime</abbr> type, the file will not be tar&shy;geted.</p><pre> 
  <code>ExpiresByType text/html A3600</code> 
</pre><p> Just like the code before, this code ba&shy;sically spec&shy;i&shy;fies that the <abbr>mime</abbr> type <code>text/html</code> expires 3600 sec&shy;onds af&shy;ter access (A).</p><p> By enabling <code>ExpiresActive</code>, we can spec&shy;ify the expiry date in a more plain en&shy;glish like syntax. In&shy;stead of defining it <code>A3600</code> it can be written like <code>access plus 1 hour</code> which means the same.</p><h2 id="result">result</h2><p> If ev&shy;ery&shy;thing went smoothly, the resul&shy;ting <abbr>http</abbr> head&shy;er should look some&shy;thing like this.</p><pre> 
  <code>HTTP/1.1 200 OK</code> 
  <code>Date: Tue, 17 Nov 2009 10:00:00 GMT</code> 
  <code>Server: Apache/2.2.13</code> 
  <code>Expires: Tue, 17 Nov 2009 10:00:00 GMT</code> 
  <code>Connection: close</code> 
  <code>Content-Type: text/html</code> 
  <code>Content-Encoding: gzip</code> 
  <code>Content-Length: 4326</code> 
</pre><h2 id="source">source</h2><p> The article se&shy;ries is sourced from var&shy;ious articles including, <a href="http://camendesign.com/website_optimisation_measures">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> by <a href="http://camendesign.com/">Kroc Camen</a>, <a href="http://meiert.com/en/blog/20080210/optimization-measures-1/">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> se&shy;ries articles by <a href="http://meiert.com/en/">Jens Meiert</a>, <a href="http://www.ryandoherty.net/2008/10/12/optimizing-openspacebook/">Opti&shy;mizing openSpaceBook</a> by <a href="http://www.ryandoherty.net">Ryan Doherty</a>, <a href="http://developer.yahoo.com/performance/">Exceptional Performance</a> by Exceptional Performance team from <a href="http://www.yahoo.com/">Yahoo</a> and <a href="http://stevesouders.com/hpws/rules.php">14 Rules for Faster-Loading Web Sites</a> by <a href="http://stevesouders.com">Steve Soud&shy;ers</a>.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/BXi4owhi54U" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/website-optimisation-part-3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/website-optimisation-part-3/</feedburner:origLink></item> <item><title>Website Optimisation: Part 2</title><link>http://feedproxy.google.com/~r/keefetang/~3/M06cgeI-PcM/</link> <comments>http://tang.waik.it/website-optimisation-part-2/#comments</comments> <pubDate>Wed, 11 Nov 2009 14:00:19 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=12</guid> <description><![CDATA[unobtrusive javascript Seperation of functionality from struc&#173;ture &#038; presentation. A lot of web devel&#173;op&#173;ers have not be&#173;gun to ap&#173;preciate this new paradigm. Javascript were once used for rel&#173;atively simple tasks like form val&#173;idation or ani&#173;mation, now it is responsible for some site’s core functionality. Un&#173;obtrusive javascript means to pro&#173;vide graceful degradation so that websites works [...]]]></description> <content:encoded><![CDATA[<h2 id="unobtrusive">unobtrusive javascript</h2><p> Seperation of functionality from <a href="#markup">struc&shy;ture</a> <span class="amp">&#038;</span> <a href="#css">presentation</a>. A lot of web devel&shy;op&shy;ers have not be&shy;gun to ap&shy;preciate this new paradigm. Javascript were once used for rel&shy;atively simple tasks like form val&shy;idation or ani&shy;mation, now it is responsible for some site’s core functionality.</p><p> Un&shy;obtrusive javascript means to pro&shy;vide graceful degradation so that websites works even with javascript disabled. Nowadays more viewers surf the web with javascript disabled, thanks to <a href="https://addons.mozilla.org/en-US/firefox/addon/722">No&shy;Script</a>. It speeds up brows&shy;ing speed and increase secu&shy;rity by blocking third party scripts, not to mention saving bandwidth<sup><a href="#fn-4" id="fnref-4">1</a></sup>.</p><h2 id="request">reduce <abbr title="Hypertext Transfer Protocol">http</abbr> requests</h2><p> When it comes to <abbr>http</abbr> requests, it is not a mat&shy;ter of speed but rather about the lim&shy;ited number of si&shy;multane&shy;ous connection. You see usu&shy;ally, browsers can han&shy;dle up to two si&shy;multane&shy;ous <abbr>http</abbr> requests, in oth&shy;er words the more files you have the brows&shy;er to download the slower the loading time becomes because no mat&shy;ter how fast of a connection you have, your brows&shy;er still will only process two at a time.</p><p> The eas&shy;i&shy;est way to reduce <abbr>http</abbr> requests is to combine files of the same type into one file. This can be applied to your <abbr title="Cascading Style Sheets">css</abbr>, javascript and im&shy;age. <abbr>css</abbr> <span class="amp">&#038;</span> javascript can be eas&shy;ily combined by hand, all you need to do is copy and paste ev&shy;ery&shy;thing into one big file. As for im&shy;ages, there is a great <a href="http://www.alistapart.com/articles/sprites/">guide</a> by <a href="http://www.alistapart.com/">A List Apart</a>.</p><p> This can also be achieved by reduc&shy;ing the number of objects in the con&shy;tent of your page. This becomes more of a judge&shy;ment call for web mas&shy;ters. If your page usu&shy;ally have a lot of objects embedded try splitting them into a number of pages, this pro&shy;vides better view&shy;ing expe&shy;ri&shy;ence while reduc&shy;ing the amount of object that needs to be request by the brows&shy;er. If it is a blog, try reduc&shy;ing the number of articles per page, if most post have lots of objects there is no shame in showing one post per page.</p><h2 id="gzip">gzip</h2><p> Gzip what ev&shy;er you can. This saves bandwidth for both you and the viewers. Ev&shy;ery&shy;thing from text files to fonts can be gziped and serve if you prop&shy;erly de&shy;fine the file type. You can man&shy;ually Gzip ev&shy;ery file before serving or you can use Apache <code>mod_deflate</code> to automat&shy;ically com&shy;press and serve with the correct file type.</p><p> To manually gzip your files just run <code>gzip [filename]</code> and you will get your new com&shy;pressed file with a <code>.gz</code> exten&shy;sion. Before you serve them you need to tell Apache what type of file is it and that the file is com&shy;pressed before it serves to your viewers by defining it in your <code>.htaccess</code> file.</p><p> By adding <code>AddType [filetype] [fileextension]</code> will tell Apache what type of file the com&shy;pressed files are and by adding <code>AddEncoding gzip [fileextension]</code> will tell Apache that the file is com&shy;pressed us&shy;ing Gzip. Af&shy;ter that all you need to do is link them from your <abrr title="Hyper Text Markup Language">html</abbr> doc&shy;u&shy;ment like you link them uncom&shy;pressed.</p><p> To automat&shy;ically serve your files com&shy;pressed by Apache just add <code>AddOutputFilterByType DEFLATE [filetype]</code> into your <code>.htaccess</code> file. Once Apache see that line of code, it will serve all files that is of the type you spec&shy;i&shy;fied com&shy;pressed.</p><h2 id="images">images</h2><p> Us&shy;ing im&shy;age is the eas&shy;i&shy;est way to show what we web devel&shy;op&shy;er wants the viewers to see, but ev&shy;ery im&shy;age file is an object for the web brows&shy;er to load. Im&shy;ages are normally big in compari&shy;son to your text files, even if you <a href="#request">combine</a> the im&shy;age file used in your <abbr>css</abbr>, you would still end up with a rel&shy;atively large file. There are sev&shy;eral ways that you can make your vis&shy;itor’s expe&shy;ri&shy;ence much more pleas&shy;ant.</p><dl><dt>Opti&shy;mise Im&shy;age</dt><dd><p> Opti&shy;mis&shy;ing your im&shy;age will reduce the size of your im&shy;age while retain&shy;ing your im&shy;age quality. All imag&shy;ing soft&shy;ware out&shy;puts inef&shy;ficient im&shy;ages that wastes val&shy;uable bandwidth, sometimes a few hundreds of kilo&shy;bytes. This means that viewers would be wast&shy;ing their time downloading need&shy;less information of the im&shy;age and imag&shy;ine if you serve ten im&shy;ages, those kilo&shy;bytes can shoot up to a few megabytes.</p><p> There are a lot of free im&shy;age opti&shy;mi&shy;sa&shy;tion ser&shy;vices avail&shy;able on the inter&shy;net, the most popular one is <a href="http://developer.yahoo.com/yslow/smushit/">Smush.it</a>. There are also tools that you can use locally like <a href="http://pmt.sourceforge.net/pngcrush/">pngcrush</a> <span class="amp">&#038;</span> <a href="http://sylvana.net/jpegcrop/jpegtran/">jpegtran</a>.</p></dd><dt>Width <span class="amp">&#038;</span> Height</dt><dd><p> Have you ev&shy;er been to a website where they have a lot of im&shy;ages but the page is jump&shy;ing all around as you read the con&shy;tent? That is because the page’s im&shy;ages have no width <span class="amp">&#038;</span> height spec&shy;i&shy;fied. Not only is this annoying it also slows down rendering speed.</p><p> When you spec&shy;ify the width <span class="amp">&#038;</span> height on <code><img></code>, your <abbr>html</abbr> doc&shy;u&shy;ment will allocate the space before the im&shy;ages are loaded thus saving some rendering time in&shy;stead of having to re&shy;allocate the space when the im&shy;ages are loaded.</p><p> By adding the width <span class="amp">&#038;</span> height will also al&shy;low readers that is reading your con&shy;tent to be able to do so with&shy;out dis&shy;turbance. Un&shy;less you have expe&shy;ri&shy;enced it your&shy;self, you have no idea how annoying it is to read a para&shy;graph half way and have to scroll down a lit&shy;tle because the loaded im&shy;age reflowed the doc&shy;u&shy;ment.</p></dd></dl><h2 id="background">background im&shy;age</h2><p> Most websites use background im&shy;ages for their background, it pro&shy;vides much more flexibility than displaying a dull, one colour background—though that is not true anymore with <abbr>css</abbr> 3 but it is still not widely support&shy;ed. While your vis&shy;itor loads a sometimes huge background im&shy;age, vis&shy;itors will look at your website with&shy;out the background im&shy;age for a short pe&shy;riod of time and one annoying thing is that the background im&shy;age sometimes is the same colour as your text, rendering it impos&shy;sible to read with&shy;out the background im&shy;age.</p><p> That is why web devel&shy;op&shy;ers need to always spec&shy;ify a background colour that closely resembles your background im&shy;age. Sometimes when you have a bad web host&shy;ing ser&shy;vice the im&shy;age might not even load and that can greatly af&shy;fect the viewers expe&shy;ri&shy;ence in your website.</p><p> For me I pre&shy;fer to let <abbr>css</abbr> han&shy;dle all my rendering. There is abolutely no im&shy;ages used to render ev&shy;ery part of this website. With <abbr>css</abbr> 3, ev&shy;ery&shy;thing gra&shy;di&shy;ent to ani&shy;mation can be done us&shy;ing <abbr>css</abbr> 3.</p><h2 id="ie6">bye bye <abbr title="Internet Explorer">ie</abbr> 6</h2><p> This is not a new top&shy;ic, my site for one is not support&shy;ing <abbr>ie</abbr> 6. For person&shy;al website, this hardly can be a diffi&shy;cult choice but when it comes to co&shy;op&shy;erate websites, it can be partic&shy;ularly diffi&shy;cult. As much as we like to ignore <abbr>ie</abbr> 6, it is likely here to stay for some time, but bare in mind that a number of large website like <a href="http://me.com/">MobileMe</a> has already tak&shy;en the first step to drop support for that ar&shy;cha&shy;ic brows&shy;er, the trend is inevitable.</p><p> I cannot be&shy;gin ex&shy;press&shy;ing my discomfort—I know I’m sugarcoat&shy;ing it—with <abbr>ie</abbr> 6. The lack of support for devel&shy;op&shy;ers to perform any de&shy;cent <abbr>css</abbr> se&shy;lection means that you can’t tar&shy;get any el&shy;e&shy;ment with&shy;out ID or class. There is also <a href="http://www.positioniseverything.net/explorer.html">rendering bugs</a> that have haunt devel&shy;op&shy;ers for years and force devel&shy;op&shy;er to produce ugly hacks that is eas&shy;ily bro&shy;ken.</p><p> Only by <a href="http://www.techcrunch.com/2009/07/14/youtube-will-be-next-to-kiss-ie6-support-goodbye/">forc&shy;ing</a> <abbr>ie</abbr> 6 to upgrade, will we see the end of it.</p><h2 id="source">source</h2><p> The article se&shy;ries is sourced from var&shy;ious articles including, <a href="http://camendesign.com/website_optimisation_measures">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> by <a href="http://camendesign.com/">Kroc Camen</a>, <a href="http://meiert.com/en/blog/20080210/optimization-measures-1/">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> se&shy;ries articles by <a href="http://meiert.com/en/">Jens Meiert</a>, <a href="http://www.ryandoherty.net/2008/10/12/optimizing-openspacebook/">Opti&shy;mizing openSpaceBook</a> by <a href="http://www.ryandoherty.net">Ryan Doherty</a>, <a href="http://developer.yahoo.com/performance/">Exceptional Performance</a> by Exceptional Performance team from <a href="http://www.yahoo.com/">Yahoo</a> and <a href="http://stevesouders.com/hpws/rules.php">14 Rules for Faster-Loading Web Sites</a> by <a href="http://stevesouders.com">Steve Soud&shy;ers</a>.</p><div class="footnotedivider"><ol><li id="fn-4"> This is especially appreciated by people living in Australia, since bandwidth there is expensive. <a href="#fnref-4">&#8617;</a></li></ol></div><img src="http://feeds.feedburner.com/~r/keefetang/~4/M06cgeI-PcM" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/website-optimisation-part-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/website-optimisation-part-2/</feedburner:origLink></item> <item><title>Website Optimisation: Part 1</title><link>http://feedproxy.google.com/~r/keefetang/~3/9-mESEVlW3Q/</link> <comments>http://tang.waik.it/website-optimisation-part-1/#comments</comments> <pubDate>Tue, 10 Nov 2009 14:00:57 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=11</guid> <description><![CDATA[It seems ev&#173;erybody is obsessed with opti&#173;mis&#173;ing their website, be it to make it run faster or to get good seo rank&#173;ing. No mat&#173;ter what your in&#173;tentions are, the principles are the same because like it or not they are closely related to each oth&#173;er. Many would think that getting good seo rank&#173;ing is differ&#173;ent [...]]]></description> <content:encoded><![CDATA[<p> It seems ev&shy;erybody is obsessed with opti&shy;mis&shy;ing their website, be it to make it run faster or to get good <abbr title="Search Engine Optimization">seo</abbr> rank&shy;ing. No mat&shy;ter what your in&shy;tentions are, the principles are the same because like it or not they are closely related to each oth&shy;er.</p><p> Many would think that getting good <abbr>seo</abbr> rank&shy;ing is differ&shy;ent from opti&shy;mis&shy;ing their website to run faster. Con&shy;trary to this be&shy;lieve, with good web opti&shy;mi&shy;sa&shy;tion your website’s <abbr>seo</abbr> rank&shy;ing will improve it&shy;self, by then it would seem that hiring some&shy;one to improve your <abbr>seo</abbr> rank&shy;ing would be redun&shy;dant. Here are, in my opin&shy;ion, some opti&shy;mi&shy;sa&shy;tion tips that you should fol&shy;low.</p><h2 id="markup">get your markups right</h2><p> This cannot be more important than any&shy;thing and yet very of&shy;ten it is ignored. The rule is to cre&shy;ate a well struc&shy;tured markup that de&shy;notes the structural se&shy;mantics of the web page.</p><h3 id="why">why?</h3><p> A good markup pro&shy;vides the meaning to the doc&shy;u&shy;ment, getting your <abbr title="HyperText Markup Language">html</abbr> markup is your most important task. Your doc&shy;u&shy;ment can have the most beautiful styles in the world but it means noth&shy;ing when it is poorly struc&shy;tured.</p><p> Having a good markup also saves a lot of time in maintain&shy;ing it. Trust me, if it is a good markup, you will not see the need to change it anymore. A well struc&shy;tured <abbr>html</abbr> markup will stand the test of time.</p><h3 id="header">header</h3><p> The <code>&lt;head&gt;</code> el&shy;e&shy;ment is one of the most abuse el&shy;e&shy;ment in a <abbr>html</abbr> doc&shy;u&shy;ment. Web mas&shy;ters very of&shy;ten shove ev&shy;ery single crap they can into the <code>&lt;head&gt;</code> el&shy;e&shy;ment. Putting all these <code>&lt;meta&gt;</code> el&shy;e&shy;ments will bring you no where while cre&shy;ating a messy and ugly code.</p><h4 id="omit">omit needless code</h4><dl><dt>Favicon</dt><dd><pre> 
      <code>&lt;<span class="purp">link</span> <span class="teal">rel</span>="<span class="green">shortcut icon</span>" <span class="teal">href</span>="<span class="green">/favicon.ico</span>" /&gt;</code> 
    </pre><p> There is absolutely no need for that line of code. Favicon has become a standard and it is support&shy;ed by all browsers. By default most brows&shy;er will automat&shy;ically re&shy;trieve the favicon that is prop&shy;erly named and placed.</p><p> Even if for some bizarre rea&shy;son you want to put your favicon some place else, you can always rewrite the <abbr title="Uniform Resource Locator">url</abbr> in your <code>.htaccess</code> file.</p></dd><dt><abbr>seo</abbr> Keywords</dt><dd><p> <abbr>seo</abbr> keywords will bring your site to <a href="http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html">no where</a>. Paying some&shy;one to “improve” your site’s <abbr>seo</abbr> rank&shy;ing is almost the same as paying your dog to clean your house, it does no good. Having a good markup howev&shy;er, will.</p></dd></dl><h4 id="css">stylesheet</h4><p> <abbr title="Cascading Style Sheets">css</abbr> is used to style the presentation se&shy;mantics, it renders your markup into your desired struc&shy;ture, so it is vital for your viewers to load the file as soon as pos&shy;sible. Let’s face it, view&shy;ing the <abbr>html</abbr> markup with&shy;out any styling isn’t very appealing to the viewers.</p><p> That is why stylesheets should be placed first, preferably af&shy;ter the <code>&lt;title&gt;</code> el&shy;e&shy;ment but if you re&shy;ally want to have the <abbr>css</abbr> file load first you can place it on top of <code>&lt;title&gt;</code>. The rest of the <code>&lt;link&gt;</code> el&shy;e&shy;ment can be place af&shy;ter the stylesheet.</p><h3 id="body">body</h3><p> The part where struc&shy;ture your con&shy;tent. It is what the viewers will see from their web brows&shy;er. The con&shy;tents are normally dynam&shy;ic so it is important to write cleanly indented markups so that it is readable.</p><p> While normal viewers will nev&shy;er look at the <abbr>html</abbr> source, there are many web designers—including my&shy;self—like to read. Having a readable markup will not only encour&shy;age oth&shy;ers to read the source it also al&shy;lows you to read them as well <sup><a href="#fn-3" id="fnref-3">1</a></sup>.</p><p>Code is beautiful, code it&shy;self can be <em>po&shy;et&shy;ry</em>.</p><h3 id="script">scripts</h3><p> Javascript’s job is to enhance the viewer’s expe&shy;ri&shy;ence when vis&shy;iting the site by defining the functionality, not to replace the web page’s <a href="#markup">struc&shy;ture</a> or <a href="#css">presentation</a>. As such, javascript should be placed at the bottom of <code>&lt;body&gt;</code> because the site should look the same even with&shy;out javascript.</p><p> This is because when browsers load the javascript file, ev&shy;ery&shy;thing stops. If your javascript file is <em>huge</em>—I don’t see any rea&shy;son why it should be—loading the script will halt ev&shy;ery&shy;thing, giving an unresponsive feel to the viewers.</p><p> An&shy;oth&shy;er rea&shy;son is that javascript cannot change the <abbr>html</abbr> <abbr title="Document Object Model">dom</abbr> until the <abbr>html</abbr> doc&shy;u&shy;ment has loaded. Plac&shy;ing the script at the top will not make it run any faster than plac&shy;ing them at the bottom.</p><h2 id="source">source</h2><p> The article se&shy;ries is sourced from var&shy;ious articles including, <a href="http://camendesign.com/website_optimisation_measures">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> by <a href="http://camendesign.com/">Kroc Camen</a>, <a href="http://meiert.com/en/blog/20080210/optimization-measures-1/">Website Opti&shy;mi&shy;sa&shy;tion Measure</a> se&shy;ries articles by <a href="http://meiert.com/en/">Jens Meiert</a>, <a href="http://www.ryandoherty.net/2008/10/12/optimizing-openspacebook/">Opti&shy;mizing openSpaceBook</a> by <a href="http://www.ryandoherty.net">Ryan Doherty</a>, <a href="http://developer.yahoo.com/performance/">Exceptional Performance</a> by Exceptional Performance team from <a href="http://www.yahoo.com/">Yahoo</a> and <a href="http://stevesouders.com/hpws/rules.php">14 Rules for Faster-Loading Web Sites</a> by <a href="http://stevesouders.com">Steve Soud&shy;ers</a>.</p><div class="footnotedivider"><ol><li id="fn-3"> When your markup goes wrong you would wish you have a readable markup to debug. <a href="#fnref-3">&#8617;</a></li></ol></div><img src="http://feeds.feedburner.com/~r/keefetang/~4/9-mESEVlW3Q" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/website-optimisation-part-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/website-optimisation-part-1/</feedburner:origLink></item> <item><title>Internet Explorer</title><link>http://feedproxy.google.com/~r/keefetang/~3/RpXzfHZM26U/</link> <comments>http://tang.waik.it/internet-explorer/#comments</comments> <pubDate>Tue, 29 Sep 2009 14:00:08 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/internet-explorer/</guid> <description><![CDATA[Having Inter&#173;net Explorer to play nice with the new web standards has been web devel&#173;op&#173;er’s dream for a long time—I know I have long wanted that—but sadly that wasn’t hap&#173;pening. Then came Google re&#173;leas&#173;ing a plu&#173;gin that ba&#173;sically lets Google Chrome’s WebKit-based rendering en&#173;g&#173;ine han&#173;dle the rendering of a page, it was a great news. [...]]]></description> <content:encoded><![CDATA[<p> Having Inter&shy;net Explorer to play nice with the new web standards has been web devel&shy;op&shy;er’s dream for a long time—I know I have long wanted that—but sadly that wasn’t hap&shy;pening. Then came Google re&shy;leas&shy;ing a plu&shy;gin that ba&shy;sically lets Google Chrome’s WebKit-based rendering en&shy;g&shy;ine han&shy;dle the rendering of a page, it was a great news.</p><blockquote><p> A hack is any&shy;thing that has the po&shy;tential to fail disas&shy;trously each time some&shy;thing changes expectedly.</p><cite>kroc camen</cite></blockquote><p> For the longest time, web devel&shy;op&shy;ers have been struggling to get their websites to render just as any oth&shy;er brows&shy;er would. The lim&shy;i&shy;tations of Inter&shy;net Explorer made it almost impos&shy;sible un&shy;less some sort of work arounds or <abbr>ie</abbr> spe&shy;cif&shy;ic hacks that forces <abbr>ie</abbr> to play nice but as Kroc Camen pointed out <q>“A hack is any&shy;thing that has the po&shy;tential to fail disas&shy;trously each time some&shy;thing changes expectedly.”</q></p><blockquote><p> […] Google Chrome Frame running as a plu&shy;gin has dou&shy;bled the attach area for malware and ma&shy;licious scripts. This is not a risk we would rec&shy;ommend our friends and fam&shy;i&shy;lies take.</p></blockquote><p> The thing is Microsoft’s frus&shy;tratingly slow adoption of the web standards forced people to come up with not so el&shy;egant solutions. It is also true that <abbr>ie</abbr> plu&shy;gins would cre&shy;ate an additional opportunity for hacker to exploit but for Microsoft to say the plu&shy;gin is not safe is not help&shy;ing at all. The prob&shy;lem was cre&shy;ated by Microsoft in the first place and in&shy;stead of fixing the prob&shy;lem, they tell people that the people who offer a solution—not a very good one, but a solution nonethe&shy;less—that they didn’t do a good job covering the mess Microsoft cre&shy;ated in the first place. Google wouldn’t need to come up with Google Chrome Frame if <abbr>ie</abbr> renders new standards prop&shy;erly, because as much as we like to stop support&shy;ing <abbr>ie</abbr>, big compa&shy;nies cannot ignore 65% of the people who surfs the web us&shy;ing <abbr>ie</abbr>.</p><blockquote><p> The performance of the scripting en&shy;g&shy;ine has lit&shy;tle discernible impact on today’s web pages, […] a faster JavaScript en&shy;g&shy;ine would offer no practical val&shy;ue to end users.</p></blockquote><p> Web standard is only a fraction of <abbr>ie</abbr>’s prob&shy;lem, we’ve seen a massive improve&shy;ments on javascript capa&shy;bilities on all major brows&shy;er to bring near native speed javascript performance so that much more so&shy;phis&shy;ticated web applications can be cre&shy;ated. Microsoft’s response to these trends? <q>“The performance of the scripting en&shy;g&shy;ine has lit&shy;tle discernible impact on today’s web pages, […] a faster JavaScript en&shy;g&shy;ine would offer no practical val&shy;ue to end users.”</q>.</p><p> I am not go&shy;ing to com&shy;ment on how ignorant that com&shy;ment was but I will say that if Microsoft con&shy;tinues to ignore the open standard and keep push&shy;ing pro&shy;pri&shy;etary technology like Silver&shy;light, they will only con&shy;tinue to see it’s brows&shy;er’s mar&shy;ket share plummet.</p><p> As much as we all like to <a href="http://www.catswhocode.com/blog/15-amazing-anti-ie-resources">de&shy;stroy</a> <abbr>ie</abbr>, what needs to be done is to stop support&shy;ing an&shy;cient browsers like <abbr>ie</abbr> 6 and force us&shy;er to switch to up to date, standard compli&shy;ant browsers.</p><img src="http://feeds.feedburner.com/~r/keefetang/~4/RpXzfHZM26U" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/internet-explorer/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/internet-explorer/</feedburner:origLink></item> <item><title>What Is doctype?</title><link>http://feedproxy.google.com/~r/keefetang/~3/1-xuyBJMqp0/</link> <comments>http://tang.waik.it/what-is-doctype/#comments</comments> <pubDate>Wed, 24 Jun 2009 14:00:21 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=8</guid> <description><![CDATA[You always hear it—always start with strict doctype—but what is doctype? doctype is short for Doc&#173;u&#173;ment Type Def&#173;i&#173;nition or mostly re&#173;ferred to as dtd and it appears at the very be&#173;ginning of the (x)html doc&#173;u&#173;ment in or&#173;der to identi&#173;fy the con&#173;tent of the doc&#173;u&#173;ment as conform&#173;ing to the partic&#173;ular dtd spec&#173;ification. dtd pro&#173;vides a list [...]]]></description> <content:encoded><![CDATA[<p> You always hear it—<a href="http://24ways.org/2005/transitional-vs-strict-markup">always</a> <a href="http://ifohdesigns.com/blog/web-design/which-doctype-is-for-me">start</a> <a href="http://accessites.org/site/2006/09/its-time-to-kill-off-transitional-doctypes/">with</a> <a href="http://juicystudio.com/article/choosing-doctype.php">strict</a> <a href="http://www.freedivs.com/tutorials/Choosing%20a%20DOCTYPE/"><abbr>doctype</abbr></a>—but what <em>is</em> <abbr>doctype</abbr>? <abbr>doctype</abbr> is short for Doc&shy;u&shy;ment Type Def&shy;i&shy;nition or mostly re&shy;ferred to as <abbr>dtd</abbr> and it appears at the very be&shy;ginning of the <abbr title="XHTML or HTML">(x)html</abbr> doc&shy;u&shy;ment in or&shy;der to identi&shy;fy the con&shy;tent of the doc&shy;u&shy;ment as conform&shy;ing to the partic&shy;ular <abbr>dtd</abbr> spec&shy;ification.</p><p> <abbr>dtd</abbr> pro&shy;vides a list of the el&shy;e&shy;ments, attributes, com&shy;ments, notes, and entities con&shy;tained in the doc&shy;u&shy;ment. It also indicates their relation&shy;ship to one an&shy;oth&shy;er with&shy;in the doc&shy;u&shy;ment. In oth&shy;er words, a <abbr>dtd</abbr> is the grammar of an <abbr>xml</abbr> or <abbr>html</abbr> doc&shy;u&shy;ment, it tells applications like your brows&shy;er or on&shy;line code val&shy;idator what type of markup you’ve coded into the page.</p><h2>Syntax</h2><p> Be&shy;low is the doctype for <abbr>xhtml</abbr> 1.0 Strict <span class="amp">&#038;</span> the syntax for <abbr>doctype</abbr> for compari&shy;son.</p><pre> 
  <code>&lt;!DOCTYPE <span class="purp">html</span> <span class="purp">PUBLIC</span> "<span class="purp">-</span>//<span class="purp">W3C</span>//<span class="purp">DTD</span> <span class="purp">XHTML 1.0 Strict</span>//<span class="purp">EN</span>" "<span class="purp">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</span>"&gt;</code> 
</pre><pre> 
  <code>&lt;!DOCTYPE [<span class="purp">Top Element</span>] [<span class="purp">Availability</span>] "[<span class="purp">Registration</span>]//[<span class="purp">Organization</span>]//[<span class="purp">Type</span>] [<span class="purp">Label</span>]//[<span class="purp">Language</span>]" "[<span class="purp">URL</span>]"&gt;</code> 
</pre><ol><li> <strong>[Top Element]</strong> &#8211; Indicates the top lev&shy;el el&shy;e&shy;ment type de&shy;clared in the <abbr>dtd</abbr>.</li><li> <strong>[Availability]</strong> &#8211; Indicates if the identi&shy;fi&shy;er is a publicly ac&shy;cessible object (PUBLIC) or a system resource (SYSTEM) such as a local file or <abbr>url</abbr>. <abbr>(x)html</abbr> <abbr>dtd</abbr>s are spec&shy;i&shy;fied by PUBLIC identi&shy;fiers.</li><li> <strong>[Registration]</strong> &#8211; Indicated by ei&shy;ther a “+” or “-”. A plus symbol indicates that the orga&shy;ni&shy;zation name that fol&shy;lows is <abbr>iso</abbr>-reg&shy;is&shy;tered. A mi&shy;nus sign indicates the orga&shy;ni&shy;zation name is not reg&shy;is&shy;tered. The <abbr>ietf</abbr> <span class="amp">&#038;</span> <abbr>w3c</abbr> are not reg&shy;is&shy;tered <abbr>iso</abbr> orga&shy;ni&shy;zations and thus use a “-”.</li><li> <strong>[Organization]</strong> &#8211; This is the “Owner&shy;ID”—a unique label indicating the name of the entity or orga&shy;ni&shy;zation responsible for the cre&shy;ation and/or main&shy;tenance of the artifact (<abbr>dtd</abbr>, etc.) be&shy;ing ref&shy;er&shy;enced by the <abbr>doctype</abbr>. The <abbr>ietf</abbr> <span class="amp">&#038;</span> <abbr>w3c</abbr> are the two orig&shy;inating orga&shy;ni&shy;zations of the of&shy;ficial <abbr>(x)html</abbr> <abbr>dtd</abbr>s.</li><li> <strong>[Type]</strong> &#8211; This is the “Public Text Class”—the type of object be&shy;ing ref&shy;er&shy;enced. There are many differ&shy;ent keywords pos&shy;sible here, but in the case of an <abbr>(x)html</abbr> <abbr>dtd</abbr>, it is “<abbr>dtd</abbr>”.</li><li> <strong>[Label]</strong> &#8211; This is the “Public Text De&shy;scription”—a unique de&shy;scriptive name for the public text that is be&shy;ing ref&shy;er&shy;enced. If the public text changes for any rea&shy;son, a new Public Text De&shy;scription string should be cre&shy;ated for it.</li><li> <strong>[Language]</strong> &#8211; This is the “Public Text Language”—the nat&shy;ural language encoding system used in the cre&shy;ation of the ref&shy;er&shy;enced object. It is written as an <a href="http://en.wikipedia.org/wiki/ISO_639"><abbr>iso</abbr> 639</a> language code. <abbr>(x)html</abbr> <abbr>dtd</abbr>s are usu&shy;ally written in En&shy;glish—“EN”.</li><li> <strong>[URL]</strong> &#8211; This is the optional explicit <abbr>url</abbr> to the <abbr>dtd</abbr> be&shy;ing ref&shy;er&shy;enced.</li></ol><h2>why specify a <abbr>doctype</abbr>?</h2><p> Because it de&shy;fines which ver&shy;sion of <abbr>(x)html</abbr> your doc&shy;u&shy;ment is actually us&shy;ing, and this is a crit&shy;ical piece of information needed by browsers or oth&shy;er tools pro&shy;cess&shy;ing the doc&shy;u&shy;ment. Tools such as the <a href="http://validator.w3.org/">markup val&shy;idator</a> needs it to check the syntax of your <abbr>(x)html</abbr> or they won’t know what doc&shy;u&shy;ment it is checking.</p><p> Most importantly, modern browsers need that to determine the type of doc&shy;u&shy;ment it is dealing with. When a brows&shy;er don’t know what doc&shy;u&shy;ment it is dealing with, it will fallback to <a href="http://www.quirksmode.org/css/quirksmode.html">quirks mode</a>, browsers will at&shy;tempt to guess at which language the doc&shy;u&shy;ment was written in and pages will be rendered much slower com&shy;pared to the standard mode and of&shy;ten in error.</p><h2><abbr>doctype</abbr> list</h2><p> The list of <abbr>doctype</abbr> are much more than what we normally use, <abbr>w3c</abbr> have the <a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html#DTD">full list</a> of <abbr>doctype</abbr> avail&shy;able to use. Some of the ones we normally use are.</p><h3><abbr>html</abbr> 4.01</h3><p>Strict, Transitional <span class="amp">&amp;</span> Frameset.</p><pre> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</code> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</code> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;</code> 
</pre><h3><abbr>xhtml</abbr> 1.0</h3><p>Strict, Transitional <span class="amp">&amp;</span> Frameset.</p><pre> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;</code> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</code> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;</code> 
</pre><h3><abbr>xhtml</abbr> 1.1</h3><pre> 
  <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;</code> 
</pre><h3><abbr>html</abbr> 5</h3><p>HTML 5&#8217;s doctype have a much simpler syntax.</p><pre> 
  <code>&lt;!DOCTYPE html&gt;</code> 
</pre><img src="http://feeds.feedburner.com/~r/keefetang/~4/1-xuyBJMqp0" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/what-is-doctype/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://tang.waik.it/what-is-doctype/</feedburner:origLink></item> <item><title>Streaming mp3 Using Google</title><link>http://feedproxy.google.com/~r/keefetang/~3/U9Jfdpi54HE/</link> <comments>http://tang.waik.it/streaming-mp3-using-google/#comments</comments> <pubDate>Sun, 21 Jun 2009 14:00:32 +0000</pubDate> <dc:creator>yun4</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://tang.waik.it/?p=10</guid> <description><![CDATA[Update: Google have removed the flash au&#173;dio player as such it is no longer pos&#173;sible to stream au&#173;dio us&#173;ing Google&#8217;s Flash player. I know there are many free flash players that plays mp3, this is just to show that we can have a flash player with&#173;out in&#173;stalling one. This mp3 player is similar to the [...]]]></description> <content:encoded><![CDATA[<p class="note"><strong>Update:</strong> Google have removed the flash au&shy;dio player as such it is no longer pos&shy;sible to stream au&shy;dio us&shy;ing Google&#8217;s Flash player.</p><p> I know there are many free flash players that plays <abbr>mp3</abbr>, this is just to show that we can have a flash player with&shy;out in&shy;stalling one. This <abbr>mp3</abbr> player is similar to the Gmail player but it also works on non-Google websites. The player has vol&shy;ume con&shy;trols and it auto-de&shy;tects the duration of the mu&shy;sic file so people know how long the song will last, best of all it has no Google banding whatsoev&shy;er on the player. Not only will we go discuss the way to stream <abbr>mp3</abbr> us&shy;ing a flash player but also to cre&shy;ate a standard complaint code for embedding flash.</p> <object type="application/x-shockwave-flash" data="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://download.yun4.net/1.mp3" width="700" height="27"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.google.com/reader/ui/3247397568-audio-player.swf" /><param name="FlashVars" value="audioUrl=http://download.yun4.net/1.mp3" /><param name="quality" value="best" /><param name="bgcolor" value="#ddd" /><param name="scale" value="noScale" /><param name="wmode" value="opaque" /><param name="salign" value="TL" /> </object><p> I first found an <a href="http://www.labnol.org/internet/design/html-embed-mp3-songs-podcasts-music-in-blogs-websites/2232/">article</a> on the var&shy;ious flash player that can be used to stream <abbr>mp3</abbr> and embed them in your website including the Google player. As nice as those players are, I refuse to use them because they uses the <code>&lt;embed&gt;</code> tag which is not a valid tag of the <abbr>xhtml</abbr> spec&shy;ification<sup><a href="#fn-1" id="fnref-1">1</a></sup>. Then again, 99% of the flash embedding code uses the <code>&lt;embed&gt;</code> tag, while some re-codes the embedding code like <a href="http://www.commoncraft.com/show">CommonCraft</a>. The <code>&lt;embed&gt;</code> el&shy;e&shy;ment was cre&shy;ated by Netscape as their method of embedding plug-ins and players in web pages. It’s not part of the <abbr>xhtml</abbr> spec&shy;ification, and while some browsers oth&shy;er than Netscape support it, it’s not standards-compli&shy;ant.</p><p> Though I didn’t like the embedding code, I liked the Google Read&shy;er player and so I searched for more information about the player. I found the long ver&shy;sion of embedding the player:</p><pre> 
  <code>&lt;<span class="purp">object</span> <span class="teal">classid</span>=<span class="green">"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"</span> <span class="teal">codebase</span>=<span class="green">"http://fpdownload.macromedia.com/pub/<br />shockwave/cabs/flash/swflash.cab"</span> <span class="teal">width</span>=<span class="green">"500px"</span> <span class="teal">height</span>=<span class="green">"27px"</span> <span class="teal">align</span>=<span class="green">"middle"</span>&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"allowScriptAccess"</span> <span class="teal">value</span>=<span class="green">"always"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"movie"</span> <span class="teal">value</span>=<span class="green">"http://www.google.com/reader/ui/3247397568-audio-player.swf"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"FlashVars"</span> <span class="teal">value</span>=<span class="green">"audioUrl=URL"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"quality"</span> <span class="teal">value</span>=<span class="green">"best"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"bgcolor"</span> <span class="teal">value</span>=<span class="green">"#EEEEEE"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"scale"</span> <span class="teal">value</span>=<span class="green">"noScale"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"wmode"</span> <span class="teal">value</span>=<span class="green">"opaque"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"salign"</span> <span class="teal">value</span>=<span class="green">"TL"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">embed</span> <span class="teal">id</span>=<span class="green">"Player"</span> <span class="teal">scale</span>=<span class="green">"noScale"</span> <span class="teal">salign</span>=<span class="green">"TL"</span></code> 
  <code>  <span class="teal">src</span>=<span class="green">"http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=URL"</span></code> 
  <code>  <span class="teal">wmode</span>=<span class="green">"opaque"</span> <span class="teal">quality</span>=<span class="green">"best"</span> <span class="teal">bgcolor</span>=<span class="green">"#EEEEEE"</span> <span class="teal">width</span>=<span class="green">"500px"</span> <span class="teal">height</span>=<span class="green">"27px"</span> <span class="teal">name</span>=<span class="green">"Player"</span></code> 
  <code>  <span class="teal">align</span>=<span class="green">"middle"</span> <span class="teal">allowScriptAccess</span>=<span class="green">"always"</span></code> 
  <code>  <span class="teal">type</span>=<span class="green">"application/x-shockwave-flash"</span> <span class="teal">pluginspage</span>=<span class="green">"http://www.macromedia.com/<br />go/getflashplayer"</span> /&gt;</code> 
  <code>&lt;/<span class="purp">object</span>&gt;</code> 
</pre><p> Again it uses the <code>&lt;embed&gt;</code> code, and so I needed a way to make a leaner, standards-compli&shy;ant method of embedding Flash. The answer? <a href="http://alistapart.com/articles/flashsatay">Flash Sa&shy;tay</a>. It ba&shy;sically teaches how to transform that ugly code to a standard compli&shy;ant code with the same capa&shy;bility thus giving us this<sup><a href="#fn-2" id="fnref-2">2</a></sup>.</p><pre> 
  <code>&lt;<span class="purp">object</span> <span class="teal">type</span>=<span class="green">"application/x-shockwave-flash"</span> <span class="teal">width</span>=<span class="green">"500px"</span> <span class="teal">height</span>=<span class="green">"27px"</span>&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"allowScriptAccess"</span> <span class="teal">value</span>=<span class="green">"always"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"movie"</span> <span class="teal">value</span>=<span class="green">"http://www.google.com/reader/ui/3247397568-audio-player.swf"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"FlashVars"</span> <span class="teal">value</span>=<span class="green">"audioUrl=URL"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"quality"</span> <span class="teal">value</span>=<span class="green">"best"</span> /&gt;</code> 
  <code>  &lt;<span class="purp">param</span> <span class="teal">name</span>=<span class="green">"wmode"</span> <span class="teal">value</span>=<span class="green">"opaque"</span> /&gt;</code> 
  <code>&lt;/<span class="purp">object</span>&gt;</code> 
</pre><p> All you need to do is replace <abbr>url</abbr> with the url to your <abbr>mp3</abbr> file and you&#8217;re set. The code is much neater and it performs just the same.</p><div class="footnotedivider"><ol><li id="fn-1"> I am a sucker for a clean, valid code <a href="#fnref-1">&#8617;</a></li><li id="fn-2"> I removed some of the attributes I don&#8217;t want, but you can still use them if you want <a href="#fnref-2">&#8617;</a></li></ol></div><img src="http://feeds.feedburner.com/~r/keefetang/~4/U9Jfdpi54HE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://tang.waik.it/streaming-mp3-using-google/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure url="http://download.yun4.net/1.mp3" length="3454393" type="audio/mpeg" /> <feedburner:origLink>http://tang.waik.it/streaming-mp3-using-google/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 6/13 queries in 1.177 seconds using disk

Served from: tang.waik.it @ 2010-09-01 14:44:22 -->
