I'm currently doing some speed optimisation and one of the main things scoring the site down is:-

"Preload key requests 2.64 s Consider using to prioritize fetching resources that are currently requested later in page load. Learn more."

I enqueue all my styles and JS files in my functions.php as follows:-

wp_register_script('jquery-ui', get_template_directory_uri() . '/assets/js/jquery-ui.min.js', array(), '1.12.1');

wp_register_style( 'jquery-ui-css', get_template_directory_uri() . '/assets/css/jquery-ui.min.css', array(), '1.12.1');
wp_enqueue_style( 'jquery-ui-css' );

How would I go about using rel="preload" with some of these files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.