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

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

Open
CaMer0n opened this issue Feb 9, 2024 · 2 comments
Labels
type: enhancement An improvement or new feature request
Milestone

Comments

@CaMer0n
Copy link
Member

CaMer0n commented Feb 9, 2024

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 CaMer0n added the type: enhancement An improvement or new feature request label Feb 9, 2024
@CaMer0n CaMer0n added this to the e107 2.4.0 milestone Feb 9, 2024
@CaMer0n
Copy link
Member Author

CaMer0n commented Feb 10, 2024

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

@Jimmi08
Copy link
Contributor

Jimmi08 commented May 14, 2024

This change caused this:

#5246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement An improvement or new feature request
Projects
None yet
Development

No branches or pull requests

2 participants