e107
e107 copied to clipboard
[Feature request]: Provide an option to improve page loading times by using defer on all javascript files.
Motivation
By using the defer attribute in HTML, the browser will load the script only after parsing (loading) the page. This can be helpful if you have a script that is dependent on other scripts, or if you want to improve the loading time of your page by loading scripts after the initial page load.
See https://www.marketingtracer.com/seo/improve-webpage-speed-defer-javascript
Proposed Solution
Move js 'settings' to its own file. Provide a flag to add 'defer' on all javascript files. Wrap inline code to make sure it is only executed after the page has loaded.
Alternatives
None
Additional Context
No response
For now use: define('e_JS_DEFER', true); to test.
This change caused this:
https://github.com/e107inc/e107/issues/5246