Skip to content

Commit

Permalink
Preload search JavaScript modules
Browse files Browse the repository at this point in the history
This circumvents the `main.js` => `search.js` => `search_index.js`
request chain to increase initial page load speed.
  • Loading branch information
jonathanhefner committed Oct 21, 2023
1 parent 71fc833 commit cd99ec4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rdoc/generator/template/rails/_head.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<link rel="preload" href="/fonts/Jost-Italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/RobotoMono-Roman.woff2" as="font" type="font/woff2" crossorigin>

<link rel="modulepreload" href="/js/search-index.js">
<link rel="modulepreload" href="/js/search.js">

<link rel="stylesheet" href="/css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/css/highlight.css" type="text/css" media="screen" />

Expand Down

0 comments on commit cd99ec4

Please sign in to comment.