<?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>blog.betabong.com &#187; html</title>
	<atom:link href="http://blog.betabong.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.betabong.com</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 10:45:13 +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>Use GZip compression for your website</title>
		<link>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/</link>
		<comments>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 09:53:50 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Frontend]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=316</guid>
		<description><![CDATA[<p>Most of my Flash apps or websites use XML files, either for communication or initial data. They can get quite large, reaching about 100 kb or more is not seldom. You might say: so what?! 100 kb is like nothing&#8230; <a href="http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/" class="read_more">Read more</a></p>
Related posts:<ol>
<li><a href='http://blog.betabong.com/2009/03/05/javascript-canvas-3d/' rel='bookmark' title='3D Point Cloud with Javascript and Canvas'>3D Point Cloud with Javascript and Canvas</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Most of my Flash apps or websites use XML files, either for communication or initial data. They can get quite large, reaching about 100 kb or more is not seldom. You might say: so what?! 100 kb is like nothing for a bandwidth nowadays! Well, if you&#8217;ve every used iPhone tethering in an area where there is no 3g network, you start appreciating every single byte you won&#8217;t have to suck from the net. (On a side note: That&#8217;s when Opera really comes in handy.)</p>
<h3>XML files compress really well</h3>
<p>Because XML usually contains a lot of repetitive elements (noticably tags and attributes), they are like a compressor&#8217;s darling. Just zip a few of your XML files and you&#8217;ll see.</p>
<p>Now I kind of always thought that on nowadays webservers gzip compression is activated by default anyway. Which was wrong, at least for quite a bunch of servers I use.</p>
<h3>Activate GZip compression</h3>
<p>If your server installation contains the deflate module (which is the case for all of the ones I use), then you can simply add the following line to your .htaccess file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># compress all html, plain text, xml, css and javascript:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript</pre></div></div>

<p>AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript</p>
<div>I&#8217;ve also tried more complex constructs found on the web, but they resulted in «Internal server errors» which is why I&#8217;ll go along with this simple one for now.</div>
<div><strong><span style="font-weight: normal;">The effects are dramatic! I usually get about 70% – 80% of reduction for non-minimized files, </span></strong></div>
<div>
<h3>Examples</h3>
</div>
<div>
<table border="0" class="small">
<tbody>
<tr>
<th></th>
<th>Uncompressed</th>
<th>Compressed</th>
<th>Reduction</th>
</tr>
<tr>
<td><strong>Javascript minimized</strong><br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js">MooTools YUI compressed</a></td>
<td>66,867</td>
<td>20,964</td>
<td>68.6%</td>
</tr>
<tr>
<td><strong>Javascript minimized</strong><br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.jss">MooTools uncompressed</a></td>
<td>102,991</td>
<td>27,599</td>
<td>73.2%</td>
</tr>
<tr>
<td><strong>XML/CSS combined</strong><br />
<a href="http://www.ceylor.ch/pages/home.xml">A larger initial XML file for a Flash website of mine</a></td>
<td>84,316</td>
<td>18,229</td>
<td>78.4%</td>
</tr>
<tr>
<td><strong>XML/CSS combined</strong><br />
<a href="http://www.ceylor.ch/pages/home.xml">A larger initial XML file for a Flash website of mine</a></td>
<td>84,316</td>
<td>18,229</td>
<td>78.4%</td>
</tr>
<tr>
<td><strong>HTML</strong><br />
<a href="http://20min.ch">A swiss news website, 20 Minuten</a></td>
<td>148,587</td>
<td>29,385</td>
<td>80.2%</td>
</tr>
<tr>
<td><strong>HTML</strong><br />
<a href="http://blog.betabong.com">My blogs home page</a></td>
<td>51,638</td>
<td>12,991</td>
<td>74.8%</td>
</tr>
</tbody>
</table>
<h3>Tools</h3>
<p>If you want to test your website, these pages are very informative (first one is faster, second one more informative):</p>
<p><a href="http://www.whatsmyip.org/http_compression/">http://www.whatsmyip.org/http_compression/</a></div>
<p><a href="http://www.gidnetwork.com/tools/gzip-test.php">http://www.gidnetwork.com/tools/gzip-test.php</a></p>
<p>I also like this one, although it only gives you little info on content-encoding. But very much on top of that :-)<br />
<a href="http://www.wmtips.com/tools/info/">http://www.wmtips.com/tools/info/</a></p>
<p>This little Firefox addon will tell you wether any site you visit has GZip activated:<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/54647">https://addons.mozilla.org/en-US/firefox/addon/54647</a> (Content Encoding Detector)</p>
<h3 style="font-size: 1.17em;">Conclusion</h3>
<p>HTML websites will profit a lot from this compression, as well as Flash sites (if just for your swfobject.js) that use textual communication. And best of all: it won&#8217;t need any kungfu effort on your side! And: practically all browsers support it. (I&#8217;ve only heard of problems with IE6, but then, you know, f*** IE6)</p>
<h3>Update:</h3>
<p>A more complete solution for your .htaccess file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;IfModule mod_deflate.c&gt;
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/xml
&nbsp;
	AddOutputFilterByType DEFLATE image/x-icon
&nbsp;
	AddOutputFilterByType DEFLATE text/css
&nbsp;
	AddOutputFilterByType DEFLATE text/javascript
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/x-javascript
	AddOutputFilterByType DEFLATE text/x-js
	AddOutputFilterByType DEFLATE text/ecmascript
	AddOutputFilterByType DEFLATE application/ecmascript
	AddOutputFilterByType DEFLATE text/vbscript
	AddOutputFilterByType DEFLATE text/fluffscript
&nbsp;
	AddOutputFilterByType DEFLATE image/svg+xml
	AddOutputFilterByType DEFLATE application/x-font-ttf
	AddOutputFilterByType DEFLATE application/x-font
	AddOutputFilterByType DEFLATE font/opentype
	AddOutputFilterByType DEFLATE font/otf
	AddOutputFilterByType DEFLATE font/ttf
	AddOutputFilterByType DEFLATE application/x-font-truetype
	AddOutputFilterByType DEFLATE application/x-font-opentype
	AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
	AddOutputFilterByType DEFLATE application/vnd.oasis.opendocument.formula-template
&lt;/IfModule&gt;</pre></div></div>

<p>(<a href="http://www.speedingupwebsite.com/2010/01/08/use-the-gzip-power/">Source</a>)</p>
<p>Related posts:<ol>
<li><a href='http://blog.betabong.com/2009/03/05/javascript-canvas-3d/' rel='bookmark' title='3D Point Cloud with Javascript and Canvas'>3D Point Cloud with Javascript and Canvas</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2010/03/25/use-gzip-compression-for-html-css-javascript-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Point Cloud with Javascript and Canvas</title>
		<link>http://blog.betabong.com/2009/03/05/javascript-canvas-3d/</link>
		<comments>http://blog.betabong.com/2009/03/05/javascript-canvas-3d/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 15:02:32 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=208</guid>
		<description><![CDATA[<p>I was doing some stuff with 3D in Flash. And so I wondered wether sth similar might be achieved with pure HTML/Javascript. And yes, modern browsers (so not IE) can!</p>
<p>What I&#8217;ve done is this (a litte simplified):</p>
<ul>
<li>Migrated</li></ul><p>&#8230; <a href="http://blog.betabong.com/2009/03/05/javascript-canvas-3d/" class="read_more">Read more</a></p>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I was doing some stuff with 3D in Flash. And so I wondered wether sth similar might be achieved with pure HTML/Javascript. And yes, modern browsers (so not IE) can!</p>
<p>What I&#8217;ve done is this (a litte simplified):</p>
<ul>
<li>Migrated my 3D engine I&#8217;ve written years ago from AS1 to Javascript</li>
<li>Extracted point cloud from Colada 3D object</li>
<li>Draw rectangles for every point to canvas</li>
</ul>
<p>And that&#8217;s how it looks:</p>
<p>    <canvas id="canvas" width="512" height="360"></canvas><br />
	<script src="http://www.betabong.com/work/lab/js/3d/3dEngine.js" type="text/javascript" charset="utf-8"></script><br />
	<script src="http://www.betabong.com/work/lab/js/3d/duck.js" type="text/javascript" charset="utf-8"></script></p>
<p>Should work on Safari, Firefox and Opera.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/03/05/javascript-canvas-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Alternative to Left Float</title>
		<link>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/</link>
		<comments>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 21:19:54 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=196</guid>
		<description><![CDATA[<p>I used to use float:left a lot for my layouts. But it can be a pain in the ass for several reasons – which of them the main may be that the surrounding box doesn&#8217;t surround it (so you&#8217;d have to&#8230; <a href="http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/" class="read_more">Read more</a></p>
Related posts:<ol>
<li><a href='http://blog.betabong.com/2009/04/22/bbml-presentation/' rel='bookmark' title='BBML Presentation at SFUG'>BBML Presentation at SFUG</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I used to use float:left a lot for my layouts. But it can be a pain in the ass for several reasons – which of them the main may be that the surrounding box doesn&#8217;t surround it (so you&#8217;d have to come up with some stupid clearfloat-hacks).</p>
<p>Anyway, I recently discovered somewhere a great alternative (you can call it hack too, but then everything a little fancy that&#8217;s supposed to work with IE is a hack, isn&#8217;t it?).</p>
<p>So while until now I&#8217;d have something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.inlinebox</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span>  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">49%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>the new method goes like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.inlinebox</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-inline-stack<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">49%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	_height<span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>That&#8217;s looks quite more complex. And it certainly is. But it works like a charm on all browsers I&#8217;ve tested (IE7, Safari, FF3). _height, zoom and *display are some crappy IE hacks obviously. The zoom attribute by the way is quite interesting, as it activates the hidden (IE only) CSS attribute hasLayout.</p>
<p>It also has some very nice benefits, like the alignement to the bottom&#8230;</p>
<h3>Example</h3>
<p><a class="download" href='http://blog.betabong.com/wp-content/uploads/2009/02/example-inlineblock.html'  target="_blank">View Example</a></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">	&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
		.codeexample span {
			background-color: #68B6FF;
			-webkit-box-reflect: below 1px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.8, transparent), to(rgba(255, 255, 255, 0.8)));
			-moz-border-radius: 5px;
			-webkit-border-radius: 5px;
			margin-right: 10px;
			margin-bottom: 40px;
			width: 140px;
			padding: 10px;
		}
		.inlinebox1 {
			display: block;
			float:  left;
			min-height: 32px;
		}
&nbsp;
		.inlinebox2 {
			display: -moz-inline-stack;
			display: inline-block;
			vertical-align: bottom;
			zoom: 1;
			*display: inline;
			min-height: 32px;
			_height: 32px;
		}
&nbsp;
	&lt;/style&gt;
&nbsp;
	&lt;div class=&quot;codeexample&quot;&gt;
		&lt;h3&gt;Float: left&lt;/h3&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox1&quot;&gt;Inlinebox&lt;/span&gt;
&nbsp;
		&lt;h3 style=&quot;clear: both;&quot;&gt;Inline Block&lt;/h3&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
		&lt;span class=&quot;inlinebox2&quot;&gt;Inlinebox&lt;/span&gt;
	&lt;/div&gt;</pre></div></div>

<p>Related posts:<ol>
<li><a href='http://blog.betabong.com/2009/04/22/bbml-presentation/' rel='bookmark' title='BBML Presentation at SFUG'>BBML Presentation at SFUG</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/02/25/css-alternative-to-left-float/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: blog.betabong.com @ 2012-02-05 05:43:58 -->
