Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vue] Performance improvement: make getCoreJs/getNonCoreJs load via defer #18982

Open
diosmosis opened this issue Mar 22, 2022 · 1 comment
Open
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@diosmosis
Copy link
Member

diosmosis commented Mar 22, 2022

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> without defer, and changing any remaining inline <script>s to use DOMContentLoaded.

@diosmosis diosmosis added the c: Performance For when we could improve the performance / speed of Matomo. label Mar 22, 2022
@diosmosis diosmosis added this to the 5.0.0 milestone Mar 22, 2022
@jane-twizel
Copy link

Included based on this being a quick/trival amount of work with the benefit of making the platform faster.

@mattab mattab added the 5.0.0 label Jan 4, 2023
@sgiehl sgiehl removed the 5.0.0 label May 5, 2023
@sgiehl sgiehl modified the milestones: 5.0.0, 6.0.0 May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants