Skip to content
Snippets Groups Projects
Commit 60c78767 authored by qsm-odoo's avatar qsm-odoo
Browse files

[FIX] web: preload font awesome font for frontend layouts


This commit adds an easy improvement fixing a page speed warning: the
font awesome font (declared in a font-face in assets_common) can be
preloaded.

The only problematic point was that font-awesome defines the font by
a series of URL using different font formats. Only one can be
preloaded (otherwise you would load files for no reason). As all Odoo
supported browsers use the woff2 format, we only preload that one. At
the cost of a warning for other browsers which use a different format.

task-2350647

closes odoo/odoo#60588

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 2d318920
Branches
Tags
No related merge requests found
......@@ -467,6 +467,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
</xpath>
<xpath expr="//head/link[last()]" position="after">
<link rel="preload" href="/web/static/lib/fontawesome/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" crossorigin=""/>
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
</xpath>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment