3
votes

I am using Domino 9.0.1 with Fix Pack 5 which gives me dojo 1.9.7. In my xsp properties I have it set to use runtime optimized JavaScript and CSS resources. I was expecting this setting to greatly reduce the number of requests made to the server when loading an XPage but it only had a minimal effect.

The culprit is dojo.js - it is doing a little over 100 separate requests to the server for various .js and resource files. I assume these are coming from the various controls I am using that utilize dojo. Is there any way to consolidate these dojo requests into a single request?

UPDATE: They are just about all coming from /xsp/.ibmxspres/dojoroot-1.9.7/dijit/ and /xsp/.ibmxspres/dojoroot-1.9.7/dojo/ and also a few from /xsp/.ibmxspres/.extlib/dijit/

UPDATE: My XSP settings:

xsp.ajax.renderwholetree=false
xsp.error.page.default=true
xsp.persistence.mode=fileex
xsp.resources.aggregate=true
xsp.user.timezone=true
xsp.html.doctype=html
xsp.theme.mobile.pagePrefix=m_
xsp.application.forcefullrefresh=true
xsp.library.depends=com.ibm.xsp.extlib.library
xsp.min.version=9.0.1
xsp.theme=vi.theme

UPDATE: I am using a dynamicContent control which is automatically loading a custom control which contains a number of controls that use dojo. This results in the XPages engine generating a bunch of script tags with dojo.require() calls in them. These calls are causing over 100 xhr requests by dojo.js.

2
Are there many files coming from "nls" directories, e.g. http://myserver/xsp/.ibmxspres/dojoroot-1.9.7/ibm/xsp/widget/layout/nls/xspClientDojo.js? - Brian Gleeson - IBM
@BrianGleeson-IBM They are just about all coming from /xsp/.ibmxspres/dojoroot-1.9.7-u/dijit/ and /xsp/.ibmxspres/dojoroot-1.9.7-u/dojo/ and also a few from /xsp/.ibmxspres/.extlib/dijit/ - jpishko

2 Answers

4
votes

My solution was to include the dojo.require() calls that the XPages engine was autogenerating in my custom control in my theme using a resources tag:

<resources>
        <dojoModule target="xsp" name="dojo.parser"></dojoModule>
        <dojoModule target="xsp" name="extlib.dijit.DynamicContent"></dojoModule>
        <dojoModule target="xsp" name="dextlib.dojo.helper.IFrameAdjuster"></dojoModule>
        <dojoModule target="xsp" name="dijit.Toolbar"></dojoModule>
        <dojoModule target="xsp" name="dijit.form.Button"></dojoModule>
        <dojoModule target="xsp" name="extlib.dijit.Menu"></dojoModule>
        <dojoModule target="xsp" name="extlib.dijit.Tabs"></dojoModule>
        <dojoModule target="xsp" name="extlib.dijit.TabPane"></dojoModule>
        <dojoModule target="xsp" name="dijit.form.DateTextBox"></dojoModule>
        <dojoModule target="xsp" name="dijit.form.TimeTextBox"></dojoModule>
    </resources>

This results in the dojo js files being aggregated. The number of requests went from 134 to 28 after doing this.

2
votes

The -u in those paths indicates that it is loading the uncompressed dojo file resources. This suggests that aggregation is not enabled.

If you look at the source pane of your application's xsp properties, it should have this property xsp.resources.aggregate=true that enables the resource aggregator. And you should remove this if it's there: xsp.client.resources.uncompressed=true. They correspond to the checkboxes highlighted below:

enter image description here