Separate non-critical javascript into separate files and delay them from loading until user interaction to negate their performance impact #28211
Closed
jazir555
started this conversation in
Feature Request
Replies: 1 comment 4 replies
-
Hi @jazir555, can you give an example of the scripts that are unnecessary? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Prerequisites
What problem is your feature request going to solve? Please describe..
Currently Elementor loads a lot of unnecessary javascript on the first render of the page which could be prevented from loading until user interaction. Much of the code loaded initially is unneeded and only utilized once a user begins to interact with the page
Describe the solution you'd like.
Non-critical javascript moved into separate files and those non-critical files are loaded after a timeout/not loaded until user interaction
Describe alternatives you've considered.
Delaying Elementor's javascript using Perfmatters/Debloat/Flyingpress etc. Unfortunately Elementor bundles critical js with non-critical js inside whole files, which makes delaying any of Elementor's javascript impossible as functionality breaks immediately. This is the case for every Elementor javascript file I've tried to delay in the waterfall request tree.
Additional context
The javascript doesn't need to be entirely removed (although that would be the best solution) to remove its performance impact. If the code is simply delayed until user interaction, it speeds up the load time for the user to view and interact with the site, while retaining all of the functionality bestowed by the code loaded after a delay.
Agreement
Beta Was this translation helpful? Give feedback.
All reactions