<?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>h4x3d.com &#187; compress</title>
	<atom:link href="http://h4x3d.com/tag/compress/feed/" rel="self" type="application/rss+xml" />
	<link>http://h4x3d.com</link>
	<description>online portfolio of Julian Klewes</description>
	<lastBuildDate>Mon, 25 Jul 2011 13:18:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Compressing moo.tools (javascript) even further</title>
		<link>http://h4x3d.com/compressing-mootools-javascript-even-further/</link>
		<comments>http://h4x3d.com/compressing-mootools-javascript-even-further/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 09:45:06 +0000</pubDate>
		<dc:creator>jez</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[moo]]></category>
		<category><![CDATA[moo.fx]]></category>
		<category><![CDATA[moo.tools]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.h4x3d.com/compressing-mootools-javascript-even-further/</guid>
		<description><![CDATA[Moo.tools is neat, I love it and use it whenever I can, but one thing is still bugging me: its size. Even though moo.tools can be downloaded compressed (using the great php5 version of dean edward&#8217;s packer), I personally find 18kb of javascript too much. So I started researching a bit with Google and found [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right;padding: 20px"><!--adsense#200_inlay--></div>
<p><a href="http://mootools.net">Moo.tools</a> is neat, I love it and use it whenever I can, but one thing is still bugging me: its size.<br />
Even though moo.tools can be <a href="http://mootools.net/download">downloaded</a> <em>compressed</em> (using the great php5 version of <a href="http://dean.edwards.name/packer/">dean edward&#8217;s packer</a>), I personally find <b>18kb</b> of javascript too much.</p>
<p><em>So I started researching a bit with Google and found out different way of compressing moo.tools (or actually whatever javascript you have) even further:</em></p>
<p>The first method, which I am using works like this:<br />
+ You rename your javascript file (moo.tools) from the original filename.js to filename.js.<b>php</b><br />
+ Open the file with your favourite editor and add the following line just at the very <em>TOP</em> of the code:</p>
<pre><code>

</code></pre>
<p>+ Next, scroll down to the end of the file in your editor and add the following to the bottom:</p>
<pre><code>

</code></pre>
<p>+ Save your file and upload it.</p>
<p>Now add it to your website using the old HTML code, but keep in mind to add the <b>.php</b>-file extension.<br />
It might look like this:</p>
<pre><code>

</code></pre>
<p class="update">I was able to reduce the whooping 18kb moo.tools down to 9kb this way. Well, actually I did not do anything, but the server and its php and zlib.</p>
<div style="float: right;padding: 20px"><!--adsense#200_inlay--></div>
<p>Other methods:<br />
At the top of Javascript:</p>
<pre><code>

</code></pre>
<p>.htaccess method<br />
Save a compressed javascript file as *.jgz, and write .htaccess like this.</p>
<pre><code>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ".*Safari.*" [OR]
RewriteCond %{HTTP:Accept-Encoding} !gzip
RewriteRule (.*)\.jgz$ $1\.js [L]

AddType "text/javascript;charset=UTF-8" .jgz
AddEncoding gzip .jgz
</code></pre>
<div style="float: right;padding: 20px"><!--adsense#200_inlay--></div>
<p>Filesmatch .htaccess method:</p>
<pre><code>

ForceType text/javascript
Header set Content-Encoding: gzip

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !".*Safari.*"
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule (.*)\.js$ $1\.js.gz [L]
ForceType text/javascript

</code></pre>
<p><u>Sources / Ideas:</u><br />
1. <a href="http://paulstamatiou.com/2007/03/18/how-to-optimize-your-css-even-more/" target="_Blank">paulstamatiou.com</a><br />
2. <a target="_Blank" href="http://joseph.randomnetworks.com/archives/2006/07/13/compressed-javascript/">randomnetworks.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://h4x3d.com/compressing-mootools-javascript-even-further/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

