cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.25k stars 1.12k forks source link

Performance: preload/prefetch/prerender pages & assets into browser cache #9113

Open garrett opened 6 years ago

garrett commented 6 years ago

When looking through a few issues today, I saw https://github.com/cockpit-project/cockpit/issues/9055, which talks about using Cockpit over a slow connection, from the point of view of page loading feedback.

This issue is about speeding up interactive performance through HTML5 hints to instruct browsers to pull down content when idle on pages.

Example uses:

These preload/prefetch/prerender (and other related, like preconnect and dns-prefetch) hints are nicely explained at https://medium.com/@luisvieira_gmr/html5-prefetch-1e54f6dda15d

Almost all browsers* now support most of these pre- directives, so it would definitely be a perceived speed boost.

(* Unsprisingly, IE & Safari lag behind in support in half of these and Edge is shaky with a preconnect. But other browsers now have full support of all of the directives. And if a browser doesn't support it, it just ignores it and nothing bad happens.)

garrett commented 6 years ago

There's another useful article @ https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/

garrett commented 3 years ago

Note: Browser support has improved since I opened this, so it's even more useful to do.