Initial loading of dynamic WebUI elements very slow

What is the problem?

Whenever i do the initial (e.g. first attempt after restarting the Raspi or restarting the Browser on the client computer) loading of Octoprint, the loading of the dynamic elements is very slow. This affects at least

  • the temperature graphs (most likely also the octoprint logo behind the temperature graph)
  • the directory listing of uploaded gcode scripts
  • the printer connection state panel

The temperature graph is empty at that time, the directory listing shows with no elements, and the printer connection state panel is not showing as connected, if there is a print going on it is not showing the printer pause and cancel buttons. All buttons are greyed out in this panel. The upload button in the directory listing panel is not greyed out. This takes around 5-10 seconds, until every needed information shows up. This is mostly inconvenient but if i want to cancel a failing print a bit more inconvenient at last, since the cancel button stays greyed out until everything is loaded.

When i refresh the browser window with Shift+R, everything loads as fast as i would expect, until i restart octoprint and the "reload interface" modal dialog is shown. If i close the browser, everything is slow again. If i open the interface on another computer, everything is slow again.

What did you already try to solve it?

I tried to determine the situations where this problem occurs. It happens on a complete backend restart or on a complete new frontend client which hasnt connected to the backend yet.
This is not a serial connection issue. This happens on active prints as well, when Octoprint is happily feeding commands to the printer. This is happening in Chrome and Safari, but the delay is slightly shorter in Safari. But it seems that Safari takes longer to render the non-dynamic elements.

Have you tried running in safe mode


Did running in safe mode solve the problem?

The dynamic elements still take some time to load, but its way faster.

Systeminfo Bundle (49.6 KB)

Additional information about your setup

Octoprint 1.6.1
Octopi 0.18.0
Ender 3 Pro
Raspberry Pi 3
Chrome and Safari on Mac OS ond Windows

Try disabling the calibration companion plugin. The developer is working on some performance issues there, I've taken a look at the code and recommended some fixes. Whenever something works in safe mode, then it's a plugin issue.

Some delay is normal here, there's a lot of information to process and render. I've been looking into some fixes recently that should increase responsiveness in the UI in future versions (1.7.0+). But even so, every plugin you add will degrade performance slightly as it adds its own resources.