Skip to content

Page load time: first visit and subsequent visits #2702

@xal-0

Description

@xal-0

Even with fast internet, https://docs.julialang.org/ can take several seconds on
first load, and almost as long for subsequent loads. This issue will attempt to
summarize the ways we can improve this.

Image

Load optimization laundry list

Don't block rendering

Reduce size of assets

  • Don't pull in all of fontawesome (260 KiB) for just a handful of icons
    (consider using svg with <symbol> definitions)

  • Font subsetting

    We pull in JuliaMono (almost 1 MiB) for good Unicode coverage, but most pages
    have only ASCII. The CDN we use should serve properly subset fonts so only
    the necessary parts are downloaded. (Example: Lato from Google Fonts).

  • Render math before serving

    Could be undesirable to pull in KaTeX and a JavaScript interpreter as a
    depdency of Documenter.jl, but it's entirely possible to render all the math
    while building the docs and avoid the KaTeX script dependency entirely.

Cache more

  • Add content hash to search index (Load time optimization: download search index asynchronously; make cacheable #2700)

  • Host the official docs somewhere that allows us to set a reasonable
    Cache-Control: max-age

    GitHub pages adds a Cache-Control: max-age=600 header to everything. This
    hurts return visits to the docs more than almost anything els: if it has been
    more than 10 minutes since your last visit, we must validate everything in the
    cache. Unfortunately this is also something we have no control over.

Other random nits

  • Don't synthesize bold Lato

    Compare synthesized bold on the left, real bold on the right (Chromium macOS):
    Image

    Apologies for including this here but this is one of those things where it
    will drive you nuts once you notice it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions