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

Defer scripts #1380

Merged
merged 2 commits into from Feb 2, 2018
Merged

Defer scripts #1380

merged 2 commits into from Feb 2, 2018

Conversation

@Rudloff
Copy link
Contributor

@Rudloff Rudloff commented Jan 16, 2018

Currently, page rendering is delayed until all scripts are loaded. But these scripts are not essential to the main content.
The defer attribute allows the browser to render the page before the scripts are completely loaded so the user can see the webpage earlier.

Defer scripts
@waylan
Copy link
Member

@waylan waylan commented Jan 16, 2018

I'm not opposed to this change, but I suspect the search script is cause for much more of a delay that these scripts are. Of course, that is being addressed as part of a larger search refactor in #859.

Regardless, this sort of change should be done in both of the included themes. If you could add the same changes to the mkdocs theme, then I'll accept this.

@Rudloff
Copy link
Contributor Author

@Rudloff Rudloff commented Jan 16, 2018

Indeed it won't help with freezes caused by the search script but it makes every page appear faster when loaded over a slow 3G connection.

I updated my PR to include a change for the mkdocs theme too.

@waylan waylan merged commit 84f9d16 into mkdocs:master Feb 2, 2018
3 checks passed
3 checks passed
codecov/project 93.66% (target 90%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Rudloff Rudloff deleted the Rudloff:patch-1 branch Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants