I've been using Dojo for about 8 months now an it rocks. I use it on my CMS, but some clients are still using dodgy internet connections, 56, 128 and in that case it is pretty slow, especially the first time.
I have my own custom build and the files are gziped which makes it a lot faster. But there still is room for improvement I guess.
Is it actually possible to merge the main dojo.js file and the build together? Is there any setting when building that can put everything in 1 file?
I've got this at the moment. It works fine, but it's still two big files. 1file would be better.
<script type="text/javascript" src="dojo/custom_built.js"></script>
But as soon as I merge these two files together and gzip them, it stops working.
The Book of Dojo doesn't give a lot of information about this, does anybody have any tips and tricks on improving this ?
Thanks

create a custom dojo.js layer
You can create a custom dojo.js layer file that contains all the javascript files you want. This is similar to how it used to work in 0.4. To do this, you specify the dojo.js layer in your profile file. An example is shown below...
layers: [
{
name: "dojo.js",
dependencies: [
"dojo.parser",
"dojo._base",
"dijit.Dialog",
"custom.widgetA"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ],
[ "custom", "../custom" ]
]
}
I'm not sure this will give you that much extra performance though. If you've only got 2 javascript files that are shrinksafe, then having only one won't give you that much of a boost. Especially since the browsers should be caching them and only reloading them if they have been modified. Once loaded the browsers shouldn't have to load them again unless they have been modified or the browser cache has been cleared.
The browser will by default ask the server if the files have been modified. You'll get 2 requests sent to the server but the response code will be a 204 i think that means the file has been unmodified since last loaded by the browser. The contents of the file aren't sent by the server in this case and the browser uses its cached version.
You can if you want even stop the check for modified javascript files from the server and always use the browser cache version. You do this by adding Cache-Control response header to the javascript response sent by the server. If you server is a java servlet container this can help you http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html.