Skip to content

Make FontAwesome script less render-blocking #2115

Open
@kaycebasques

Description

@kaycebasques

PageSpeed Insights indicates that the FontAwesome script is a large render-blocking resource on pigweed.dev:

Image

https://pagespeed.web.dev/analysis/https-pigweed-dev-modules-html/9mbvtl2kbd?form_factor=mobile

Currently the FontAwesome script loads in <head>. Proposal here is to load it at the end of <body> instead.

Time to first paint will improve, but some users may see a flash of unstyled content. When the FontAwesome script loads and executes, the unstyled content will get rendered as icons. Presumably this might also cause the browser to recalculate layout.

I'm OK with this tradeoff. If you don't want to impose this change on all PyData Sphinx Theme users, then maybe we can expose it as a configurable option. I.e. loading in <head> remains the default, but there's a config option that lets me load FontAwesome at the end of <body> instead.

(The same thing goes for searchindex.js but I will address that in a different issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: discussionNeeds discussion before an implementation can be made

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions