• Hello,

    Google Speed Page test shows me that I should to add preloading request to decrease page loading time(please see image1). I have added a preload attribute for some fonts from the file fl-icons.css through the plugin WP Rocket(please see image2). And another fonts and file fl-icons.css I have added in file header.php before the tag </head>(please see image3). But a position “Preload key request” stayed in the list of Opportunities of the Google test. Why it happenes, what am I doing wrong?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Most javascript files and CSS files are loaded in the functions.php file, not the header.php. There is usually a section dedicated to enqueing styles and scripts. This is how WordPress recommends doing it. Header.php usually has a hook called wp_head which marks the place where the enqueued data will be places. There is also a wp_footer that is responsible for marking the place where footer scripts will be placed.

    Any changes you are making should be done in a child theme. If you make changes in the theme to either of these files, there is a chance your changes will be overwritten the next time your theme updates. Here is a suggestion on stack exchange on how to add the preload to your styles. https://wordpress.stackexchange.com/questions/353589/enqueue-custom-font-file-with-rel-preload Good Luck !

    Thread Starter abilis

    (@abilis)

    I have inserted a snippet to my functions.php file. And the record appeared in html code(see image). But anyway Google shows recomendation “Preload key requests”(see image). Any ideas why it happens?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Preload key requests(Google Speed Page)’ is closed to new replies.