e107 icon indicating copy to clipboard operation
e107 copied to clipboard

[Feature request]: Provide an option to improve page loading times by using defer on all javascript files.

Open CaMer0n opened this issue 1 year ago • 2 comments

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

CaMer0n avatar Feb 09 '24 23:02 CaMer0n

For now use: define('e_JS_DEFER', true); to test.

CaMer0n avatar Feb 10 '24 00:02 CaMer0n

This change caused this:

https://github.com/e107inc/e107/issues/5246

Jimmi08 avatar May 14 '24 08:05 Jimmi08