In my web app i call several services, so i can display a lot of data in the page. However, the slowest service takes the max of 3 seconds to run, and the page takes a lot more time to load. Seems like it does the calls 1 by 1, showing the results when all are called. This is hapening when it opens the page at start, the services have auto-refresh as true.
I want to know if theres any option that forces the services to run async from 1st load, because when i use async command interval it all seems to work fine.
Shouldn’t i use auto refresh?
You could consider using an alternate approach. You could keep auto-refresh to false and then have a script that fires after the DOM has been loaded. That script would invoke refresh on each of the webservices. You can learn more about invoking multiple web-services here: http://tech.forums.softwareag.com/techjforum/posts/list/24591.page;jsessionid=50D8095B3275D09506C924046DB45A97
As far as listening to the Dom-loaded event you can use:
The problem was a service that i was calling that was atking too long… over 5 seconds and then it gave errors to the page because the that long duration.
Having a web app calling several services is better to use a single async command interval to refresh all at same time or have a async command interval for each service ?
Well, you probably want to display some data to the user as soon as possible. So if you call those services one at a time, you’ll probably get some data to render quickly. I’d also recommend investigating what can be done to get that Web Service to not take so long.