Support » Theme: Astra » Preload key requests in ASTRA theme

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello @zotezo

    You can use the code in the following gist to prefetch the required files.

    I hope that helps.


    Hello! So the error in Chrome disappeared for me (if you use this code):
    I apologize! For SVG, it also gives an error.
    Here is the error in Chrome: “The resource https: //…./wp-content/themes/astra/assets/fonts/astra.svg#astra was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally.”
    If you remove rel = “preload”, the error in Chrome disappears and PageSpeed does not indicate an error with the SVG

    It could be like this??: <link rel="prefetch" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.svg#astra" as="font" crossorigin />

    In the settings of the plugin “Autoptimize” there is a field “Preload specific requests”. I took advantage of this plugin function and learned links with rel = “preload”. The links look like this:
    <link rel = "preload" href = "https: //...../wp-content/themes/astra/assets/fonts/astra.woff" as = "font" type = "font / woff" crossorigin> <link rel = "preload" href = "https: //...../wp-content/themes/astra/assets/fonts/astra.ttf" as = "font" type = "font / ttf" crossorigin> <link rel = "preload" href = "https: //...../wp-content/themes/astra/assets/fonts/astra.svg#astra" as = "other">

    Hi! I am facing the same issue. Pagespeed insights is showing the same error. I am zero in coding stuff. Kindly tell me if the above-mentioned code (in the last answer) the right solution to this? I have added it in autoptimize but still, the error is showing up in pagespeed insights.

    Secondly, @brainstormteam kindly if you include this functionality by default in your next update, it will be great. As Google gives importance to such things, including this by you will be greatly appreciated by the users.


    Hello @sandzee33987

    Yes, you can use the above code but you will need to select which resources you need to prefetch.

    Or you can use the code in the following gist to prefetch the required files.

    And yes, we do have this lined up in our list but won’t be possible in the next update. As our upcoming update has been finalized and is in the testing phase.

    I hope that helps. If you need any further help, please reach out to us through the links provided here.


    Hi! Thanks for your code under GitHub link. Loading time of my page for desktops is many fastest after using the PHP code. Please have you any advice of this type for cellphones too?

    Thanks a lot

    Hello @aanbreek

    Is there any specific issue you are facing on the responsive device, please share so that our community or us can help?

    Glad to hear that the issue helped somewhat and particularly on Desktop devices.

    Looking forward to hearing from you.

    Suman 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Preload key requests in ASTRA theme’ is closed to new replies.