0
votes

We have a page that takes a while to load the first time. The second time it loads fine. We tried the following hack in the startup script:

 var page = app.currentPage;
 app.showPage(app.pages.bigForm);
 app.showPage(page);

This hack does work, the page loads fast the first time it is accessed by the user. The screen does not flash between the loads. However, the bigform does not detach and the first time it is opened it does not execute the on-attach event. This event contains some code I would like to execute.

My questions:

  • is there a better way of doing this, basically pre-loading the page?
  • is there a way to force a detach of the page?
1

1 Answers

0
votes

I would recommend to start from looking for causes of slow load. Most common reasons are:

Large number of widgets to render (this will cause rendering throttle)

There are no much things you can do in this case:

  • Split page into multiple pages
  • If you have widgets that you need to show conditionally you can use createChildren method is called option in panel's Performance Settings instead of particular widgets' visible settings

Heavy queries to server or big number of queries

To tune app's performance in this scenario you can try these tricks:

  • eagerly load some datasources on app start
  • Use datasource prefetches for relational data (this easy tweak usually gives huge performance boost)