I have a multi page app that I am finding has a slow initial page load speed.
My question - when the app is first visited, do all the callbacks from all the pages trigger, or is it just the callbacks from the currently active page that triggers? If they all trigger, is there a way to disable this?
There are 10 pages, all of which are pulling data from an AWS RDS db, and uploading it to a datatable component and a chart.
In my experience it is only the active pages that are loaded. You could easily check this yourself with a print statement when the callback is triggered.
You can speed the load time if you also set
app = Dash(__name__, use_pages=True, suppress_callback_exceptions=True)
If you exclude this,
pages will automatically create a
app.validation_layout for you under the hood, which can slow the load time. (More info here)
Note that if your page layouts are functions, it may still be slow, however this will be fixed in the next release (2.6.2) coming soon.
Thanks @AnnMarieW .
My layouts are currently functions in other modules, that I am importing into the module with the callbacks.
When the update arrives, will the update make using layout as a function the same speed as using app.layout directly, or will there still be a difference between the two of them?