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

Add preloading hints for default fonts #72843

Closed

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 1, 2020

This adds preloading hints to rustdoc's HTML for certain fonts
that are always loaded from the server. This enables browsers
to improve loading performance of the page.

This is an attempt to improve on the situation discussed in #20962 and also for historical interest it is following up on lessons learned in #72557 (comment)

Browsers lazy-load fonts in @font-face rules. The generation, calculation, and styling of a std doc page takes entire seconds, whereas loading a font takes milliseconds. It's hard to know when exactly the fonts are requested, but examining results from webpagetest.org suggests it could take entire seconds into the page load. Using <link> for all of rustdoc's webfonts might be unwise (it would be wasted loads if the fonts are local), and CSS extensions can override these, but as long as the CSS is unaltered we can be confident a visitor to a rustdoc page will want these fonts.

This adds preloading hints to rustdoc's HTML for certain fonts
that are always loaded from the server. This enables browsers
to improve loading performance of the page.
@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2020
@steveklabnik
Copy link
Member

r? @rust-lang/rustdoc

@workingjubilee
Copy link
Member Author

Reviewing the theme and extension logic here, I am more uncertain about this PR being correct now, and could use guidance on how to assure the assumptions it rests upon are in fact correct.

@Elinvynia Elinvynia added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 10, 2020
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2020
@Dylan-DPC-zz
Copy link

Had a discussion with the reviewer, and given the uncertainty around this, i'm closing this pr.

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 23, 2020
@workingjubilee workingjubilee deleted the add-font-preload branch October 4, 2021 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants