async load the dashboard widgets
Dahfrenk opened this issue · comments
The issue; I have a website that has quite a bit of data in it and I have created some dashboards that require some time to load. (Especially when creating year reports). When a user visits the backend, they are first met with the dashboard and because the dashboard will only show itself once all widgets are loaded in, the dashboard can take a few moments to load and cause a bad user experience.
A possible solution; It would be nice to see that dashboard widgets could be loaded in besides each other after the page is loaded in. I attempted this myself by using AJAX and snippets but quickly came to the conclusion I cannot render partials in a widget and could not get the desired result.
I hope you will consider it!
Hi @Dahfrenk
All the widget containers load via AJAX to keep the page running fast as a single request. If a widget is expensive to load, consider lazy loading its contents, or caching its contents with a lazy loaded recache.
So on the first load it can look like this:
<div
id="myWidgetContents"
data-request="onLoadWidgetContents"
data-auto-submit></div>
I hope this helps.
Documentation link: https://docs.octobercms.com/3.x/cms/features/polling.html#lazy-loading-requests