Hi Martin,

Yes, that's right. 

The dojo "requires" seemed unexpectedly slow during our tests. I was using
Firefox's Firebug to check page load times. From memory, it looked like the
dojo includes were being requested sequentially and seemed to give
substantial page loading overhead (>2s) even if the dojo .js files were
cached. 

I never fully understood why there was a large overhead although the dojo
files were supposedly cached. It might have been a quirk with firebug and
dojo "requires", or maybe the "requires" routine itself is slow, when called
30+ times.

About 5 dojo files were consistently returning "not found" as well, which
may not have helped the load times.

Removing as much dojo stuff as I could, and upgrading from Struts 2.0.8 to
2.0.9 has solved our page load time issues.

Regards
Jason


-----Original Message-----
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Friday, 21 September 2007 11:41 AM
To: Struts Users Mailing List
Subject: Re: [s2] Struts head tag KILLS (> 10s) page load time

Hi Jason-

so by attentuating dojo includes you decreased initial load time for dojo
with the beneficial side effect of faster response to the browser?

Thanks/
Martin--
----- Original Message -----
From: "Jason Wyatt" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Thursday, September 20, 2007 9:09 PM
Subject: RE: [s2] Struts head tag KILLS (> 10s) page load time


>I had the same issue... We use the ajax tabbed panel but no other dojo
> widgets, but the <s:head theme="ajax"> tag had dojo "requiring" all of the
> dojo widget library.
>
> This was causing our page to fire off 70+ requests when loading. As our 
> app
> needs to be accessed up to a thousand km away, tests showed initial load
> times of over 10s because of latency.
>
> I modified web\template\ajax\head.ftl to include a custom
> web\hack\ajax\dojoRequire.js that had the minimum dojo includes for the
> tabbed panels. This managed to get the number of requests down to around 
> 30,
> mostly our own images and scripts, which gave acceptable load times.
>
> Eg.
>
> web\template\ajax\head.ftl:
>
> <#include "/${parameters.templateDir}/${themeProperties.parent}/head.ftl" 
> />
> <script type="text/javascript"
>        src="<@s.url value='/hack/ajax/dojoRequire.js' includeParams='none'
> encode='false'  />"></script>
> <script type="text/javascript"
>        src="<@s.url value='/struts/CommonFunctions.js' 
> includeParams='none'
> encode='false'/>"></script>
>
>
> web\hack\ajax\dojoRequire.js:
>
> dojo.require("dojo.io.BrowserIO");
> dojo.require("dojo.event.topic");
>
> dojo.hostenv.setModulePrefix('struts', 'struts');
> //dojo.require('dojo.widget.*');
> dojo.widget.manager.registerWidgetPackage('struts.widget');
>
> dojo.require("struts.widget.Bind");
> dojo.require("struts.widget.BindDiv");
> //dojo.require("struts.widget.BindAnchor");
> //dojo.require("struts.widget.ComboBox");
> //dojo.require("struts.widget.StrutsTimePicker")
> //dojo.require("dojo.widget.Editor2");
> //dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman
> debugger to work with the includes
>
>
> Hope this helps, regards
> Jason
>
> -----
> Falun Dafa  Truth - Compassion - Forbearance
>
> A mind & body practice under persecution in China
>
> http://www.faluninfo.net
>
>
>
>
>
> -----Original Message-----
> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> Sent: Friday, 21 September 2007 8:09 AM
> To: Struts Users Mailing List
> Subject: Re: [s2] Struts head tag KILLS (> 10s) page load time
>
> If Dojo is being used for AJAX in this case, that's my guess.  I know from
> experience that Dojo, can issue a TON of requests even if you think your
> only loading a small portion of it.  Assuming this guess is correct,
> Musachy, does S2 use a custom build of Dojo?  If not, that might be worth
> considering.
>
> Frank
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
> Author of "Practical Ajax Projects With Java Technology"
>  (2006, Apress, ISBN 1-59059-695-1)
> and "JavaScript, DOM Scripting and Ajax Projects"
>  (2007, Apress, ISBN 1-59059-816-4)
> Java Web Parts - http://javawebparts.sourceforge.net
>  Supplying the wheel, so you don't have to reinvent it!
>
> chengas123 wrote:
>> Hi,
>> I am working on a Struts 2 page and page load times are way too high.
>> I tracked it down to the Struts head tag, which I have as follows:
>> <s:head theme="ajax" /> Without the tag, my page issues 3 requests and
>> takes 453ms to load.  With the tag, the page issues 54 requests taking
>> 12.24s to load.
>> Is there something I am doing wrong here?
>>
>> Thanks,
>> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to