Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    I don’t use avada so I can’t speak directly to your experience there. I can share with you how I’ve done preloads with a client site and maybe it will be helpful for you.

    I added a new ‘action’ very near the top of the <head> element called ‘wp_head_preload’, like so:

    <!doctype html>
    <html <?php language_attributes(); ?>>
    	<head>
    		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    		<?php do_action( 'wp_head_preload' ); ?>
    		...etc
    	</head>

    Then in my functions.php, I have a function outputting all of my preload and preconnect links:

    function rel_preloads_preconnect() {
    	?>
    	<link rel="preload stylesheet" href="{preload_asset_url}" as="style" crossorigin="anonymous">
    	<?php
    }
    add_action( 'wp_head_preload', 'rel_preloads_preconnect' );

    I did it this way so that I could have more control over where in the head these were output, to make sure they were very early in the load. I recall doing a bit of tinkering with rel preload vs. preconnect for different asset types needing to set an ‘as’ type, and define crossorigin. I fiddled with all those settings and rechecked things with pagespeed until Google was happy.

    I hope this helps.

    • This reply was modified 2 years, 7 months ago by Matt Keys.
    Thread Starter montybuns

    (@montybuns)

    Wow thank you Matt I am going to follow your direction and start to implement this!

    This is fantastic!

    Thank you so much.
    Kind regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Preload Key Requests Avada issue’ is closed to new replies.