[Vue] Performance improvement: make getCoreJs/getNonCoreJs load via defer #18982
Labels
c: Performance
For when we could improve the performance / speed of Matomo.
Milestone
Refs #18981
One potential improvement to page load time: currently the getCoreJs/getNonCoreJs controller actions are synchronous, meaning page load is blocked until they finish, and they can't be split apart and loaded in parallel because of inline scripts that assume they have already been loaded.
The Vue migration will slowly move more of the code currently in getCoreJs out to chunks that are loaded in parallel, but it won't remove all of it. So it would still be an improvement to get them to load concurrently, and without blocking rendering of the page.
Loading them asynchronously is not currently possible as Matomo allows and uses inline scripts that are not deferred, and which assume the existence of JavaScript libraries and Matomo classes/functions being available. During development of Matomo 5, however, it will be possible to disallow inline scripts that are not deferred, change existing scripts and make these two requests load asynchronously.
This one is trivial once the Vue migration is done. It's just disallowing inline
<script>
withoutdefer
, and changing any remaining inline<script>
s to use DOMContentLoaded.The text was updated successfully, but these errors were encountered: