- This topic has 5 replies, 2 voices, and was last updated 4 years, 6 months ago by
David.
-
AuthorPosts
-
October 30, 2021 at 8:05 am #1984215
t29k75
Hi,
I’m self-hosting Mulish 400 and 700 weight fonts.
I am trying to preload them, but it looks like it is not working.I created hook element (wp_head, entire site).
Added the link content: `<link rel=”preload” as=”font” type=”font/woff2″ href=”https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-regular.woff2″ crossorigin=”anonymous”>
<link rel=”preload” as=”font” type=”font/woff2″ href=”https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-700.woff2″ crossorigin=”anonymous”>`my font face CSS: `/* mulish-regular – latin */
@font-face {
font-family: ‘Mulish’;
font-style: normal;
font-weight: 400;
src: local(‘Mulish Regular’), local(‘Mulish-Regular’),
url(‘https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-regular.woff2’) format(‘woff2’),
url(‘https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-regular.woff’) format(‘woff’);
}
/* mulish-700 – latin */
@font-face {
font-family: ‘Mulish’;
font-style: normal;
font-weight: 700;
src: local(‘Mulish Bold’), local(‘Mulish-Bold’),
url(‘https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-700.woff2’) format(‘woff2’),
url(‘https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-700.woff’) format(‘woff’);
}`In LiteSpeed Cache settings am using
font-display:swap;After viewing any of the pages (after clearing cache) FOUT is still visible. Could you please look into it?
thanks,
TiborOctober 30, 2021 at 8:24 am #1984230David
StaffCustomer SupportHi there,
the display=swap will tell the browser to use its system font to display whilst the actual font is downloaded.
And preload font may commence loading the font quicker, but if there is a slight delay in the font loading and the page loads really fast then the display=swap is going to do its thing.Personally i would disable the display=swap option.
October 30, 2021 at 8:42 am #1984247t29k75
I changed ‘display=swap’ to ‘default’ option in LSCache (have to choose one or the other). Loading the pages looks same. Could I use/overwrite it with something else then swap & default and add it to font-face css?
…and is mine hook link content correct, please?<link rel=”preload” as=”font” type=”font/woff2″ href=”https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-regular.woff2″ crossorigin=”anonymous”>
<link rel=”preload” as=”font” type=”font/woff2″ href=”https://surf-atlantic.com/wp-content/themes/generatepress_child/fonts/mulish-v3-latin-700.woff2″ crossorigin=”anonymous”>thanks
October 30, 2021 at 9:50 am #1984309David
StaffCustomer SupportI am not seeing the FOUT anymore – have you tried clearing any browser caches ?
October 30, 2021 at 10:53 am #1984363t29k75
yes I did, or usually I am viewing it in incognito mode…but if it is not there anymore, am happy!
thanks David
October 30, 2021 at 2:31 pm #1984513David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.