-
Notifications
You must be signed in to change notification settings - Fork 501
Description
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.
Load optimization laundry list
Don't block rendering
- Don't block waiting for search index (Load time optimization: download search index asynchronously; make cacheable #2700)
- Don't block waiting for fontawesome, other font CSS
- Remove require.min.js entirely (Reconsider how we deploy JS assets (aka. let's get rid of RequireJS) #2158)
- Don't block for various other "info" scripts (
siteinfo.js,versions.js) - Rendering should not block while loading themes that are not in use.
- Set
font-display: swap;for all fonts
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-ageGitHub pages adds a
Cache-Control: max-age=600header 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.

