Thursday, February 10, 2011

XPages: dojo performance tip

This tip is most valid if there's a big difference between edit mode and read mode.

You can compute if dojo modules are rendered the same way you compute any other component.
E.g. in this.resources (source mode):
<xp:dojoModule name="dijit.Editor" rendered="#{javascript:return currentDocument.isEditable();}" />
In one of my XPages the read mode has 17 requests, and the edit mode has 56 requests.

I don't notice much difference, as I'm on a decent line with low latency, but for users with low bandwith/high latency the difference can probably be highly noticable.