Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Preload assets using resource hints #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions views/includes/common-preloads.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<link rel="preload" href="g-ui/index.js" as="script">
<link rel="preload" href="https://origami-build.ft.com/v2/bundles/js?export=bundle&modules=o-expander@^4.0.2,o-buttons@^4.0.2,o-date@^2.6.0,o-cookie-message@^2.2.0" as="script">
<link rel="preload" href="https://origami-build.ft.com/v2/files/[email protected]/MetricWeb-Regular.woff?#iefix" as="font">
<link rel="preload" href="https://origami-build.ft.com/v2/files/[email protected]/FinancierDisplayWeb-Regular.woff?#iefix" as="font">
5 changes: 5 additions & 0 deletions views/polls-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
]
%}

{% block appendhead %}
<link rel="preload" href="main.js" as="script">
{% include "includes/common-preloads.html" %}
{% endblock -%}

{% block article_body %}

<nav class="nav___mobile-nav{{ ' page__national' if code == 'us' }}">
Expand Down
2 changes: 2 additions & 0 deletions views/result.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
%}

{% block appendhead %}
<link rel="preload" href="result-page.js" as="script">
{% include "includes/common-preloads.html" %}
<script>
var pageDataTimestamp = {{ overview.timestamp }};
</script>
Expand Down