cancel
Showing results for 
Search instead for 
Did you mean: 

Preload Fonts

SOLVED

Preload Fonts

I am trying to increase my PageSpeed score, one of the suggestions is to preload a font, can anyone let me know how to accomplish this in magenta 2
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Preload Fonts

Hello @miller75 

 

Please refer https://stackoverflow.com/questions/49674092/preloading-font-with-rel-preload

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

View solution in original post

4 REPLIES 4

Re: Preload Fonts

Hello @miller75 

 

Please refer https://stackoverflow.com/questions/49674092/preloading-font-with-rel-preload

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Preload Fonts

 

51-MAVERIX-Tall-Sans-Serif-Font

Re: Preload Fonts

A construction estimating services company specializes in providing accurate cost assessments for construction projects. These companies help contractors, architects, and property developers by preparing detailed estimates for labor, materials, equipment, and other project expenses. takeoff service

Re: Preload Fonts

To preload a font in Magento 2:

Upload the Font: Ensure your font file (e.g., WOFF2) is stored in a publicly accessible directory, such as pub/media.

Edit Theme Configuration: Navigate to your theme’s layout XML file (default_head_blocks.xml in app/design/frontend/<Vendor>/<Theme>/Magento_Theme/layout/) and add a preload directive for the font in the <head> section.

Ensure Cross-Origin Access: Configure your web server to allow cross-origin requests for fonts by setting appropriate headers.

Deploy Changes: Run Magento commands to update and flush caches.

Same happened with my Grinding Services Chicago site and it got solved easily, just follow the above process.

This process ensures the font is preloaded for faster rendering and helps improve your PageSpeed score.