<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Digital Carpenter - Web Development</title>
    <link>http://www.digitalcarpenter.com.au/</link>
    <description>Build the web your way</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 06 Jan 2009 08:57:51 GMT</pubDate>

    <image>
        <url>http://www.digitalcarpenter.com.au/templates/competition/img/s9y_banner_small.png</url>
        <title>RSS: Digital Carpenter - Web Development - Build the web your way</title>
        <link>http://www.digitalcarpenter.com.au/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Decreasing AJAX web app loading times</title>
    <link>http://www.digitalcarpenter.com.au/archives/24-Decreasing-AJAX-web-app-loading-times.html</link>
            <category>Doculicious</category>
            <category>Web Development</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/24-Decreasing-AJAX-web-app-loading-times.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    &lt;p&gt;When developing &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt;, one of my main concerns was how fast the heavy JavaScript parts would load and run in the browser. &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt; uses a fairly customised version of the &lt;a href=&quot;http://dojotoolkit.org/&quot;&gt;Dojo Toolkit&lt;/a&gt;, and the raw files that were being loaded for some pages added up to over 550KB - made up of about 50 individual files, all being loaded by Dojo with its packaging system. This was fine for development and great for debugging, but I knew I had to do something before this went into production. In this post I&#039;ll talk about some of the things we use in &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt; to make our JavaScript smaller and load faster, but still easy to develop on. Hopefully it should be general enough to help anyone who has a site using JavaScript, but we use Dojo so is a bit focused on its packaging system which includes multiple files at run-time. If your app doesn&#039;t use Dojo but has multiple JavaScript files, you&#039;ll probably still get some benefit out of this.&lt;/p&gt;

&lt;p&gt;There are 2 main ways to speed up a JavaScript application - Make the JavaScript load faster into the browser, and make it run quicker. There&#039;s a great article at IBM developerWorks called &lt;a href=&quot;http://www.ibm.com/developerworks/web/library/wa-aj-perform/?ca=dgr-lnxw01FasterAjax&quot;&gt;AJAX performance analysis&lt;/a&gt; that goes into both of these. The first section talks about the tools to use in Web application development - &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; and &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;YSlow&lt;/a&gt;, which are both required tools on any development box I use. The next goes into reducing the network transfer time, and this is where I&#039;ll focus on what we did with doculicious.&lt;/p&gt;

&lt;h4&gt;Reducing File Size and HTTP requests&lt;/h4&gt;&lt;p&gt;The Dojo Toolkit uses a packaging system similar to Java, and it&#039;s a great way to separate out all the files and keep them organised and easy to develop. We&#039;ve created our own package for doculicious and one of our JavaScript heavy pages may require up to 50 individual files to be included. Because of current &lt;a href=&quot;http://www.ajaxperformance.com/2006/12/18/circumventing-browser-connection-limits-for-fun-and-profit/&quot;&gt;browser connection limits&lt;/a&gt;, this is way too much, and it&#039;s much better to limit the number of JavaScript files to one or two instead of loading many. &lt;/p&gt;

&lt;p&gt;What I wanted to do for doculicious was to create individual files for each JS heavy page, with each file including just the JavaScript code it needed. This individual file could then be used with the dojo.js file so that all the required JavaScript for a page would be in 2 files. Because Dojo automatically includes JS files depending on which widgets and functions are used, I needed to define which ones were used on which page so that I could join them all together. Firebug is great for this, and using the &lt;span style=&quot;font-weight: bold;&quot;&gt;Net&lt;/span&gt; tab quickly lets you see all the included JS files:&lt;/p&gt;
&lt;img src=&quot;http://www.digitalcarpenter.com.au/uploads/firebug.png&quot; style=&quot;margin: 10px 10px 0pt 0pt;&quot; title=&quot;Firebug&quot; alt=&quot;Firbug&quot; /&gt;

&lt;p&gt;My initial goal was to create a range of &quot;base&quot; files that could be concatenated together in an Ant script to create a JavaScript file for any doculicious page. Using Firebug to find the common files across each of our pages, I made a list of all the Dojo specific files that were needed, and also of our custom doculicious files. At this point I realised that each of our pages used very similar Dojo functions and widgets, so I made the decision to manually join these together into one file that could be included across all the files I needed. This is probably not the best thing to do if you are using the latest version of Dojo or another packaging system, as when changes are made it will be harder to integrate them, but our base Dojo is version 0.4.3 and I do not plan on upgrading it. We&#039;ve only found a couple of bugs over the past 18 months, so I&#039;m comfortable that this base is stable. &lt;/p&gt;

&lt;p&gt;Concatenating your JavaScript into a single file is great for production code, but you still need to develop on it. So when doing this we need to keep our individual files available for development, while having a simple process to make the production code. I use Eclipse with the MyEclipse plugin as my IDE. The JavaScript project is structured like below, with the &lt;span style=&quot;font-weight: bold;&quot;&gt;js&lt;/span&gt; folder being included in the web project so that it is deployed along with it:&lt;/p&gt;

&lt;pre&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;JavaScript Project&lt;/span&gt;
&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;buildscripts&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;build&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;functions&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;widgets&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;lib&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - build.xml
&amp;#160;&amp;#160; -&lt;span style=&quot;font-weight: bold;&quot;&gt; js&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;digitalcarpenter&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;system&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Command.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - DocumentState.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - State.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - ...
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;widgets
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Canvas.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Elements.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - ...
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - dojo_functions_widgets_minimal.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - dojo.js
&lt;/pre&gt;
Underneath the &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo&lt;/span&gt; folder is the &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo_functions_widgets_minimal.js&lt;/span&gt; file which contains all the dojo functions and widgets that our pages need. The &lt;span style=&quot;font-weight: bold;&quot;&gt;digitalcarpenter&lt;/span&gt; folder is our base package, and contains all our individual JavaScript files, including widgets and system classes. Under the &lt;span style=&quot;font-weight: bold;&quot;&gt;buildscripts&lt;/span&gt; folder is our build file and a &lt;span style=&quot;font-weight: bold;&quot;&gt;build&lt;/span&gt; folder to hold temp files. The &lt;span style=&quot;font-weight: bold;&quot;&gt;lib&lt;/span&gt; folder holds some tools we will use later. The ant script is pretty basic, here&#039;s what it does:
&lt;ol&gt;&lt;li&gt;At the beginning we define the paths that are used and the files we are going to create.&lt;/li&gt;&lt;li&gt;We then build the directory structure for the build&lt;/li&gt;&lt;li&gt;Then in&amp;#160;&lt;span style=&quot;font-weight: bold;&quot;&gt;copy&lt;/span&gt; we move all the files we are going to use into the &lt;span style=&quot;font-weight: bold;&quot;&gt;build/functions&lt;/span&gt; and &lt;span style=&quot;font-weight: bold;&quot;&gt;build/widgets&lt;/span&gt;. Taking care to not move stuff that isn&#039;t needed, such as testing files, images and css.&lt;/li&gt;&lt;li&gt;Next we define a regular expression replace to remove all lines with &quot;dojo.require&quot; on them. This line is the way Dojo knows which files to include, and it&#039;s not needed in our final file because all the code is together. In fact things break if these are left in. Depending on which JS library you use, you may not need to do something similar when cancatenating your files together.&lt;/li&gt;&lt;li&gt;The next area is where we actually create our specific file. First we copy the base file to our working directory, then we concat all the individual files together, appending them to this file. Order may be important. Some of the widgets in our code include other widgets, so they need to be added before-hand.&lt;/li&gt;&lt;li&gt;The last step is calling ./lib/custom_rhino.jar. This is the Dojo &lt;a href=&quot;http://dojotoolkit.org/docs/shrinksafe&quot;&gt;ShrinkSafe&lt;/a&gt; application which removes comments and shrinks down the code. I highly recommend that you use this. ShrinkSafe has worked great for all of my JS, and I&#039;ve never had errors. Because it parses the JavaScript it does a great job. It will even tell me if I&#039;ve left some horrible bug in the code.&lt;/li&gt;&lt;li&gt;At the end is the &lt;span style=&quot;font-weight: bold;&quot;&gt;create&lt;/span&gt; and &lt;span style=&quot;font-weight: bold;&quot;&gt;clean&lt;/span&gt; methods you use to run the whole thing.&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;overflow: scroll; height: 400px;&quot;&gt;&lt;pre&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&amp;lt;project name=&quot;DigitalCarpenter_JavaScript&quot; default=&quot;create&quot;
	basedir=&quot;.&quot;&amp;gt;
	&amp;lt;description&amp;gt;
		Creates the javascript files needed for Doculicious.
	&amp;lt;/description&amp;gt;
	&amp;lt;!-- set global properties for this build --&amp;gt;
	&amp;lt;property name=&quot;build&quot; location=&quot;build&quot; /&amp;gt;
	&amp;lt;property name=&quot;widgets&quot; location=&quot;${build}/widgets&quot; /&amp;gt;
	&amp;lt;property name=&quot;functions&quot; location=&quot;${build}/functions&quot; /&amp;gt;
	&amp;lt;property name=&quot;lib&quot; location=&quot;lib&quot; /&amp;gt;
	&amp;lt;property name=&quot;dojo_src&quot; location=&quot;${basedir}/../js/dojo&quot; /&amp;gt;
	&amp;lt;property name=&quot;dc_src&quot; location=&quot;${basedir}/../js/digitalcarpenter&quot; /&amp;gt;
	
	&amp;lt;property name=&quot;dojo_base&quot; value=&quot;dojo_base&quot; /&amp;gt;
	&amp;lt;property name=&quot;dojo_minimal&quot; value=&quot;dojo_functions_widgets_minimal&quot; /&amp;gt;
	&amp;lt;property name=&quot;base_workshop_dojo_file&quot; value=&quot;workshop_dojo&quot; /&amp;gt;
	&amp;lt;property name=&quot;document_workshop_js&quot; value=&quot;document_workshop&quot; /&amp;gt;

	&amp;lt;target name=&quot;init&quot;&amp;gt;
		&amp;lt;!-- Create the build directory structure used to create the JS files --&amp;gt;
		&amp;lt;mkdir dir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;mkdir dir=&quot;${widgets}&quot; /&amp;gt;
		&amp;lt;mkdir dir=&quot;${functions}&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;copy&quot; depends=&quot;init&quot;&amp;gt;
		&amp;lt;copy file=&quot;${dojo_src}/${base_workshop_dojo_file}.js&quot; todir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;copy file=&quot;${dojo_src}/${dojo_minimal}.js&quot; todir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;copy todir=&quot;${functions}&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${dc_src}/system&quot; /&amp;gt;
		&amp;lt;/copy&amp;gt;
		&amp;lt;copy todir=&quot;${widgets}&quot; includeEmptyDirs=&quot;false&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${dc_src}/widget&quot;&amp;gt;
				&amp;lt;exclude name=&quot;&lt;u&gt;_package_&lt;/u&gt;.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;ButtonField.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;InlineEditor.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;RichEditor.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;TestWidget.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;Popup.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/*&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/buttons/*&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/images/*&quot; /&amp;gt;
			&amp;lt;/fileset&amp;gt;
		&amp;lt;/copy&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;remove_dojorequires&quot; depends=&quot;copy&quot;&amp;gt;
		&amp;lt;replaceregexp match=&#039;dojo.require&#039; replace=&quot;//dojo.require&quot; byline=&quot;true&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${widgets}&quot;/&amp;gt;
		&amp;lt;/replaceregexp&amp;gt;
		
		&amp;lt;replaceregexp match=&#039;dojo.require&#039; replace=&quot;//dojo.require&quot; byline=&quot;true&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${functions}&quot;/&amp;gt;
		&amp;lt;/replaceregexp&amp;gt;
	&amp;lt;/target&amp;gt;

	&amp;lt;target name=&quot;document_workshop&quot; depends=&quot;remove_dojorequires&quot;&amp;gt;
		&amp;lt;copy file=&quot;${build}/${base_workshop_dojo_file}.js&quot; 
                               tofile=&quot;${build}/${document_workshop_js}.js&quot; /&amp;gt;
		&amp;lt;!-- NOTE: The order of the below files is important -
		            later code expects the previous code to be available --&amp;gt;
		&amp;lt;concat destfile=&quot;${build}/${document_workshop_js}.js&quot; append=&quot;true&quot;&amp;gt;
	    	&amp;lt;filelist id=&quot;dw_functions&quot; dir=&quot;${functions}&quot;&amp;gt;
			    &amp;lt;file name=&quot;Utils.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;SHA1.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Constants.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Command.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;DocState.js&quot;/&amp;gt;
			&amp;lt;/filelist&amp;gt;
			&amp;lt;filelist id=&quot;dw_widgets&quot; dir=&quot;${widgets}&quot;&amp;gt;
				&amp;lt;!-- file name=&quot;Resizer.js&quot;/ --&amp;gt;
			    &amp;lt;file name=&quot;ImagePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FloatingImagePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;TextField.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Element.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Canvas.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;ColorPalette.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FontSizePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FontPicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;RichTextToolbar.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Dialog.js&quot;/&amp;gt;
			&amp;lt;/filelist&amp;gt;
	  	&amp;lt;/concat&amp;gt;
	  	
	  	&amp;lt;antcall target=&quot;-rhino-compress&quot;&amp;gt;
			&amp;lt;param name=&quot;srcFile&quot; value=&quot;${build}/${document_workshop_js}&quot; /&amp;gt;
		&amp;lt;/antcall&amp;gt;
		&amp;lt;!-- Copy the completed file to the js/dojo directory - 
                           will overwrite the one already there --&amp;gt;
		&amp;lt;copy overwrite=&quot;true&quot; 
                               file=&quot;${build}/${document_workshop_js}.js&quot; 
                               tofile=&quot;${dojo_src}/${document_workshop_js}.js&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;-rhino-compress&quot; unless=&quot;nostrip&quot;&amp;gt;
		&amp;lt;copy overwrite=&quot;true&quot; file=&quot;${srcFile}.js&quot; tofile=&quot;${srcFile}.uncompressed.js&quot; /&amp;gt;
		&amp;lt;java jar=&quot;./lib/custom_rhino.jar&quot; 
                              failonerror=&quot;true&quot; 
                              fork=&quot;true&quot; 
                              logerror=&quot;true&quot; 
                              output=&quot;${srcFile}.js&quot;&amp;gt;
			&amp;lt;arg value=&quot;-strict&quot; /&amp;gt;
			&amp;lt;arg value=&quot;-opt&quot;/&amp;gt;
			&amp;lt;arg value=&quot;-1&quot; /&amp;gt;
			&amp;lt;arg value=&quot;-c&quot; /&amp;gt;
			&amp;lt;arg value=&quot;${srcFile}.uncompressed.js&quot; /&amp;gt;
		&amp;lt;/java&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;create&quot; depends=&quot;clean, init, copy, remove_dojorequires, document_workshop&quot; 
                          description=&quot;creates the javascript files&quot;&amp;gt;
		&amp;lt;echo message=&quot;All done! :)&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;

	&amp;lt;target name=&quot;clean&quot; description=&quot;clean up&quot;&amp;gt;
		&amp;lt;!-- Clean up the files used --&amp;gt;
		&amp;lt;delete dir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;delete dir=&quot;${widgets}&quot; /&amp;gt;
		&amp;lt;delete dir=&quot;${functions}&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Cool, we&#039;ve now got our Ant file ready to create the individual files. The example above creates only one file. Our production one creates a couple of different files. Because this allows you to pick and choose individual files you can customise the generated JS very specifically. Doculicious has two main &quot;applications&quot;. One is the front end web form and the other is the template/style creator. They use similar functions and widgets, but doing it this way I can save about 30kb on the uncompressed files by only including the stuff each page needs. &lt;/p&gt;

&lt;p&gt;Now when I&#039;m developing on my code I can just comment out the single file call at the top of the HTML page and uncomment the dojo.require lines to use the individual files, allowing us to program on nicely formatted files that have comments and line breaks. When everything&#039;s tested and ready for prod we just re-comment the dojo.requires, uncomment the individual line, run &lt;span style=&quot;font-weight: bold;&quot;&gt;ant create&lt;/span&gt; and increment the jsVersion variable so that clients get the new version.&lt;/p&gt;
&lt;div&gt;&lt;pre&gt;
&amp;lt;!-- Comment out the following line to test the individual js files
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://www.digitalcarpenter.com.au/js/dojo/document_workshop.js?v${jsVersion }&quot;&amp;gt;&amp;lt;/script&amp;gt;		 
--&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
	&amp;lt;!-- Uncomment these to test the individual js files--&amp;gt;
	dojo.require(&quot;digitalcarpenter.widget.Element&quot;);
	dojo.require(&quot;digitalcarpenter.widget.Canvas&quot;);
	dojo.require(&quot;digitalcarpenter.system.DocState&quot;);
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now our production code is all nicely together in one file. We still have commented and formatted code to develop on, and running it all through ShrinkSafe has also lowered the file size. Our uncompressed file has gone from 370KB to 262KB, but most importantly we&#039;ve gone from about 50 individual file calls to 2. The file size still seems large, but with mod_deflate on Apache2 it comes down to 68KB and with aggressive caching, clients should only need to download it when we change it.&lt;/p&gt;


  &lt;div class=&quot;flockcredit&quot; style=&quot;text-align: right; color: #CCC; font-size: x-small;&quot;&gt;Blogged with the &lt;a href=&quot;http://www.flock.com/blogged-with-flock&quot; style=&quot;color: #999; font-weight: bold;&quot; target=&quot;_new&quot; title=&quot;Flock Browser&quot;&gt;Flock Browser&lt;/a&gt;&lt;/div&gt;&lt;!-- technorati tags begin --&gt;&lt;p style=&quot;font-size:10px;text-align:right;&quot;&gt;Tags: &lt;a href=&quot;http://technorati.com/tag/AJAX&quot; rel=&quot;tag&quot;&gt;AJAX&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/Web%20development&quot; rel=&quot;tag&quot;&gt;Web development&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20web%202.0&quot; rel=&quot;tag&quot;&gt; web 2.0&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20JavaScript&quot; rel=&quot;tag&quot;&gt; JavaScript&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20&quot; rel=&quot;tag&quot;&gt; &lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt; 
    </content:encoded>

    <pubDate>Wed, 24 Dec 2008 09:39:05 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/24-guid.html</guid>
    
</item>
<item>
    <title>Blogging from Flock</title>
    <link>http://www.digitalcarpenter.com.au/archives/21-Blogging-from-Flock.html</link>
            <category>Web Development</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/21-Blogging-from-Flock.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=21</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    I installed the &lt;a href=&quot;http://www.flock.com&quot;&gt;Flock&lt;/a&gt; browser a little while ago because I wanted 2 different browsers on my machine for testing websites, and also so I could have multiple sessions running. I initially wanted to use Safari, but then found out it there isn&#039;t a version that runs under Ubuntu.&lt;br /&gt;
&lt;br /&gt;
I&#039;m glad I made this choice. It&#039;s funny actually, because I began using it just to test sites, then I noticed it&#039;s social media extras, and thought I&#039;d sign up for twitter. Now I&#039;m writing this blog post using it. And after testing my site and doing some browsing, it actually feels a lot faster than Firefox too. I installed Firebug and yslow, so now am pretty happy to make this my default browser.&lt;br /&gt;
  &lt;div class=&quot;flockcredit&quot; style=&quot;text-align: right; color: #CCC; font-size: x-small;&quot;&gt;Blogged with the &lt;a href=&quot;http://www.flock.com/blogged-with-flock&quot; style=&quot;color: #999; font-weight: bold;&quot; target=&quot;_new&quot; title=&quot;Flock Browser&quot;&gt;Flock Browser&lt;/a&gt;&lt;/div&gt;&lt;!-- technorati tags begin --&gt;&lt;p style=&quot;font-size:10px;text-align:right;&quot;&gt;Tags: &lt;a href=&quot;http://technorati.com/tag/flock&quot; rel=&quot;tag&quot;&gt;flock&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/technology&quot; rel=&quot;tag&quot;&gt;technology&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20browser&quot; rel=&quot;tag&quot;&gt; browser&lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Dec 2008 21:52:20 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/21-guid.html</guid>
    
</item>
<item>
    <title>Busy, busy, busy</title>
    <link>http://www.digitalcarpenter.com.au/archives/5-Busy,-busy,-busy.html</link>
            <category>Web Development</category>
            <category>Widgely</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/5-Busy,-busy,-busy.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    I&#039;ve been busy hacking away at the code behind &lt;a href=&quot;http://www.widgely.com&quot;&gt;Widgely,&lt;/a&gt; trying to make it into a more modular form so that I can re-use it across some other website ideas I have. This month will be very busy while I get this new idea launched, and make sure that the code is reusable.&lt;br /&gt;
&lt;br /&gt;
I can see great potential for the template/document creation code behind &lt;a href=&quot;http://www.widgely.com&quot;&gt;Widgely,&lt;/a&gt; and I&#039;ve got heaps of ideas for how to make some cool sites using it. But I need to focus on some ideas that have the potential for me to make some money from them. I love doing this, but in the end, I have to pay the bills. Widgely is a great website (If I do say so myself :), and so far the users I have seem to like it. Many keep coming back, and I can see through the Google Analytics that they spend a good amount of time on the site, creating documents. But a site like this is hard to monetize untill we have large amounts of users, who will only come when there is content, which only comes when there is a large amount of users, which .... you get the picture.&lt;br /&gt;
&lt;br /&gt;
So I plan on using the code behind widgely to create some more sites with a greater business flavour. One&#039;s that solve some problems for people who are willing and capable of paying. The first will be launched in a couple of weeks, and then I&#039;ll be working on another that is really getting me excited &lt;img src=&quot;http://www.digitalcarpenter.com.au/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Wed, 09 Jul 2008 10:27:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/5-guid.html</guid>
    
</item>

</channel>
</rss>