Skip to content

Commit

Permalink
Merge pull request #2104 from yrodiere/search-preconnect
Browse files Browse the repository at this point in the history
Pre-connect to the search service on guide search pages
  • Loading branch information
gsmet authored Aug 29, 2024
2 parents a2570cf + 68895f7 commit 8350098
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
<link rel="alternate" hreflang="x-default" href="https://quarkus.io/" />
<script src="{{ site.baseurl }}/assets/javascript/tracking.js"></script>
{% if search_wc %}
{% comment %}
The first connection to the remote search service can be slow,
and once in this block we're pretty sure to use the remote search service.
Pre-connecting in the background speeds up the first call to the service.
Note "crossorigin" is necessary for this to work, because we use CORS.
{% endcomment %}
<link rel="preconnect" href="{{ site.search.host }}" crossorigin />
<script src="{{ search_script_src }}" type="module" blocking="render"></script>
{% endif %}
<script src="{{ '/assets/javascript/colormode.js' | relative_url }}" type="text/javascript"></script>
Expand Down

0 comments on commit 8350098

Please sign in to comment.