Skip to content

Commit

Permalink
Prerender report pages (#893)
Browse files Browse the repository at this point in the history
* prerender report pages

* eager prefetch, moderate prerender

* list

* Simplify approach

---------

Co-authored-by: Barry Pollard <[email protected]>
Co-authored-by: Barry Pollard <[email protected]>
  • Loading branch information
3 people authored Dec 1, 2024
1 parent 2020adf commit 0a3dce0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@
{% block scripts %}
<script defer src="{{ get_versioned_filename('/static/js/web-vitals.js') }}" nonce="{{ csp_nonce() }}"></script>
<script defer src="{{ get_versioned_filename('/static/js/send-web-vitals.js') }}" nonce="{{ csp_nonce() }}"></script>
<script type="speculationrules" nonce="{{ csp_nonce() }}">
{
"prefetch": [{
"where": {
"href_matches": "/reports/*"
},
"eagerness": "eager"
}],
"prerender": [{
"where": {
"href_matches": "/*"
},
"eagerness": "moderate"
}]
}
</script>
{% endblock %}
</body>
</html>

0 comments on commit 0a3dce0

Please sign in to comment.