Okay
  Public Ticket #2083783
Preload css for Google pagespeed
Closed

Comments

  • wenzelaus2211 started the conversation

    Hi,


    when checking my site via Google Pagespeed I always get the suggestion that I need to preload my ressources:

    https://www.heidihofer.com/wp-content/plugins/LayerSlider/static/layerslider/skins/v5/skin.css


    This is both on mobile and desktop. I use WP Rocket (all CSS options on like minify, summarizing and optimizing the css presentation) and I use an CDN from my hoster (1and1). I tried some options on your Layerslider options page but nothing could solve this "error". Actual the following option from your Layerslider are on (Use slider markup caching, Include scripts in the footer, Conditional script loading and the editor extensions)

    So my questions are:

    - How can I preload your css files (on one page there are two) so Google pagespeed won't complain?

    - Why are these css files loaded on the mobile version? I do not use them there or better said I use the Slider fallback image here... How can I bring Layerslider to not load this css script at all?


    Thanks a lot and btw really fantastic plugin!


    Michael

  • [deleted] replied

    Hello Michael,

    Thank you for getting in touch with us. My name is Attila and I'm happy to assist you today. I appreciate your patience while we've been working towards your ticket.

    Unfortunately you won't be able to preload the skin file. It is dynamically loaded depending on which skin is needed. 

    It is most likely loading on mobile, because the slider is still there in the background, it's just hidden. It depends on how you implemented the slider and how your theme handles it. But usually, when the slider is hidden, it does not take up any considerable resources, and the browser still caches the skin, so it does not really have any importance.