1

I am currently working on a project that is using Dojo as the js framework. Its a rather rich ui and as such is using (and thus loading) a lot of different .js files for the dojo plug-ins

When run on an apache server running on a mac, the files (all around 1k) are served very quickly (1 or 2 ms) and the page loads pretty fast (<5 seconds)

When run on IIS on Win 7, the files are served at an unbelievably slow rate (150ms - 1s), thus causing the page to take up to 3 minutes to load.

I have searched the internet to try to find a solution and have come up empty.

Anyone have any ideas?

3 Answers 3

2

Why not let Google serve the Dojo files for you?

The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries. By using the google.load() method, your application has high speed, globally available access to a growing list of the most popular, open source JavaScript libraries.

3
  • I've tried the google cdn with the same general response time (its faster, but not orders of magnitude). I'm almost convinced its a dojo thing, but am stuck to explain the apache performance. Eventually we are thinking about using a single compiled dojo library (which can be gzipped).
    – Josh
    Commented Apr 8, 2010 at 15:19
  • All right I take that back. The google cdn loads the base stuff quickly. Still the custom plugins that have been written that have to load of our server load slow. so though the cdn fixes part of the problem, the root problem is still there, just slightly mitigated by the cdn :)
    – Josh
    Commented Apr 8, 2010 at 15:32
  • This doesnt fix the real problem which is IIS taking 500ms to return a 304, but it does alleviate 95% of the pain since IIS is no longer serving the standard portion of dojo.
    – Josh
    Commented Apr 12, 2010 at 12:42
1

What you need to do is build an optimized version of your code. That way you will have far fewer hits to your server (but I guess they'll still be slow, until you discover the iis problem) Dojo runs out of the box as individual files which is great for development, but without running the build scripts to concatenate all these files together, the experience is poor. The CDN does build profiles for dojo base and certain profiles, like dijit.dijit. Doing a dojo.require on these profiles in addition to the individual requires would enable this after running a build. You would need to do create layers for your code as well. The build scripts can also concatenate css and inline template files, remove comments and whitespace, etc.

1
  • 1
    Yeah, I found this. My problem is that creating the optimized version for code that is still in flux is a bit of overhead. I started using the google cdn for the standard stuff, but the custom code still loads slower than I would expect
    – Josh
    Commented Apr 12, 2010 at 12:37
0

Have you actually tried measuring the load times on the intended target production server?

If you're just testing this on local development environments (or in development/test VM's) then I think you're comparing apples with oranges (pardon the pun :) ).

1
  • Unfortunately, I have to debug / test / write it on the machine I have :) Just trying to avoid 2 minute page loads when i change a css class
    – Josh
    Commented Apr 12, 2010 at 12:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.