<?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>Mohanjith&#039;s Blog &#187; compress</title> <atom:link href="http://mohanjith.net/blog/topics/compress/feed" rel="self" type="application/rss+xml" /><link>http://mohanjith.net/blog</link> <description>MOHA blogging news and thoughts...</description> <lastBuildDate>Wed, 14 Dec 2011 14:18:18 +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>Recipe for compressed script.aculo.us</title><link>http://mohanjith.net/blog/2008/03/recipe-for-compressed-scriptaculous.html</link> <comments>http://mohanjith.net/blog/2008/03/recipe-for-compressed-scriptaculous.html#comments</comments> <pubDate>Fri, 28 Mar 2008 12:46:00 +0000</pubDate> <dc:creator>S H Mohanjith</dc:creator> <category><![CDATA[compress]]></category> <category><![CDATA[script.aculo.us]]></category> <category><![CDATA[yui]]></category><guid
isPermaLink="false">http://mohanjith.net/wordpress/?p=58</guid> <description><![CDATA[TweetI was searching for a compressed version of script.aculo.us javascript library in one file. The search turned out almost fruitless; I found outdated script.aculo.us versions compressed. It was obvious to me that I was on my own. I also wanted to post the method to do it instead of the result. YUI compressor was the [...]]]></description> <content:encoded><![CDATA[<p><span
style="float: right; margin: 5px 0px 0px 5px;" ><a
class="twitter-share-button"  data-via="mohanjith" data-count="vertical" data-related="" data-lang="en" data-url="http://mohanjith.net/blog/2008/03/recipe-for-compressed-scriptaculous.html" data-text="Recipe for compressed script.aculo.us" href="http://twitter.com/share?via=mohanjith&#038;count=vertical&#038;related=&#038;lang=en&#038;url=http%3A%2F%2Fmohanjith.net%2Fblog%2F2008%2F03%2Frecipe-for-compressed-scriptaculous.html&#038;text=Recipe%20for%20compressed%20script.aculo.us" >Tweet</a></span>I was searching for a compressed version of <a
href="http://script.aculo.us">script.aculo.us</a> javascript library in one file. The search turned out almost fruitless; I found outdated script.aculo.us versions compressed. It was obvious to me that I was on my own. I also wanted to post the method to do it instead of the result.</p><p><a
href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a> was the best tool I could use to compress any javascript. YUI combined with gzip compression for compatible browsers would produce the smallest on the wire javascript files (See http://www.julienlecomte.net/blog/2007/08/13/).</p><p>First attempt to put all the script.aculo.us files into one file failed with mismatched dependencies. I had to find out the correct order to concat the files. As I found out the order should be scriptaculous.js, builder.js, effects.js, controls.js, dragdrop.js, slider.js, sound.js (I have specifically left out unittest.js). If you want you can throw in <a
href="http://prototypejs.org/">Prototype</a> into the mix at the begining as it is required by script.aculo.us (I did that).</p><p>Run the following command in a shell prompt from the script.aculo.us root. to concat prototype and script.aculo.us.<pre> $ cat lib/prototype.js src/scriptaculous.js src/builder.js src/effects.js src/controls.js src/dragdrop.js src/slider.js src/sound.js > scriptaculous.bundle.js</pre><p> You need to download YUI compressor, run the following command.<pre> $ java -jar /path/to/yui/compressor/build/yuicompressor.jar scriptaculous.bundle.js -o scriptaculous.bundle.min.js</pre><p>In my case I use YUI compressor version 2.3.5 and script.aculo.us 1.8.1, and the file sizes were 244KB scriptaculous.bundle.js and 146KB scriptaculous.bundle.min.js. That&#8217;s a 40% compression.</p><p>You need to configure your web server to serve javascript files gzipped for user agents that are accepting gzipped content. You have to do your own reasearch for that <img
src='http://cdn.mohanjith.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . After gzip compression was turned on for javascript files the size of scriptaculous.bundle.min.js on the wire is 41K, that&#8217;s a 83% compression, wow that&#8217;s alot of saving on bandwidth and loading time.</p><p>You can download the compressed and bundled script.aculo.us <a
href="http://mohanjith.net/downloads/script.aculo.us/1.8.1/scriptaculous.bundle.min.js">scriptaculous.bundle.min.js</a>. Hope someone will finds it useful.</p><div
id="fb-like" style=""><iframe
src="http://www.facebook.com/plugins/like.php?href=http://mohanjith.net/blog/2008/03/recipe-for-compressed-scriptaculous.html&amp;layout=standard&amp;show_faces=true&amp;width=300&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:300px; height:30px"></iframe></div>]]></content:encoded> <wfw:commentRss>http://mohanjith.net/blog/2008/03/recipe-for-compressed-scriptaculous.html/feed</wfw:commentRss> <slash:comments>5</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: basic (User agent is rejected)
Database Caching 16/19 queries in 0.008 seconds using memcached
Object Caching 0/0 objects using memcached
Content Delivery Network via cdn.mohanjith.net

Served from: mohanjith.net @ 2012-05-30 08:39:05 -->
