質問

How to speed up the initialization of rich dojo page, with many modules that are required?

I'm making a Dojo 1.9 startup application, which in this moment has only GridX, without any additional dijit wigdets (the final application will have also a filter build with dijit widgets).

The initialization requires in the moment 259 requests, which takes, with active FireBug network logging, 1.79 s. Without firebug, it take a bit faster, but anyway, the number of requests is immense.

When I activate the caching of without must-revalidate for dojo modules, it is a bit faster (and at least it doesn't kill the server) but it is still about a second. Although the caching is active, there are some requests made to server anyway - they are the GETs for HTML templates (such as gridx/templates/Grid.html).

My question is, is it possible to speed up the initialization somehow? For example, is it possible to merge all the modules used by my start page into one, and say the AMD loader not to make requests for them? Or at least merge the CSS into the bigger ones, for example single one for GridX? Are there maybe tools for it?

役に立ちましたか?

解決

Yes you can tweak some things. You can create a custom build for example by using the following link: http://dojotoolkit.org/documentation/tutorials/1.9/build/. I'm not sure if that will help that much (didn't follow it completely), but there's also a web tool that allows you to create custom builds and compress them into a single JS file (according to a colleague of mine). Try the Dojo web builder, I think it would probably help you a lot.

I'm not sure if you did already, but did you define async: true in your dojoConfig? I'm not sure if it will help, but you can always try it.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top