skip to Main Content

Trying to optimize my WordPress site and I have a few questions about how I can improve. Further down in this post you can see that Google PageSpeed is recommending me to remove unused CSS as well as render blocking content, my questions are:

  1. The jQuery file seems large to me, why 780ms for a cached jQuery file?
  2. And is it logical for the cached css to slow down my page?

Let me know if you need more info. Thank you very much!

Page URL: https://utanuc.nu

Theme:

  • Hello Elementor

Plugin:

  • WP Rocket Pro

Removed unused CSS:

  • /wp-content/cache/min/1/aad770152f8bd8d0197b0ef0ecc3052b.css (143 kb)

Rendering Blocking Content:

  • /wp-content/cache/busting/1/wp-includes/js/jquery/jquery-1.12.4-wp.js (780 ms to load)

4

Answers


  1. You can install this plug-in to remove caches.
    https://en-gb.wordpress.org/plugins/wp-fastest-cache/

    Login or Signup to reply.
  2. Google Page Speed tells you that cached files slow down your page not because cached files are slower than non-cached ones.

    It’s because (for example) file: /wp-content/cache/min/1/aad770152f8bd8d0197b0ef0ecc3052b.css is a combination of all your CSS files and it is the only one, so it contains all your theme, plugins and WP CSS code.

    When files are not cached Page Speed checks them and it is listing every file (for example) like: 20 files * 50ms. Now when it is one cached file, Google checker tells you something like 1 file * 1200ms – and the one is faster but it’s one so looks like a big website slowing file.

    By the way, you have to know, that current page speed result is really good for a website based on a heavy theme like Hello Elementor so it will be hard to speed it up without changing listed theme.

    With regard to jQuery – Page Speed tells me that it is loading 136ms, so maybe you have changed something or maybe Page Speed is giving different results in specific cases.

    Login or Signup to reply.
  3. Actually what has been said so far is incorrect due to misunderstanding what each bit means.

    Rendering Blocking Content:

    Render blocking content is content that the page has to load in order to render everything ‘above the fold’ (first page full of content you can see without scrolling).

    As it is the JavaScript blocking the page you can use the defer attribute on all of your JavaScript files (I don’t use Rocket but have a look if you can find a setting that allows you to set all JavaScript to defer).

    This means that the page will only start loading the JS once all the HTML has loaded and been parsed, therefore not ‘blocking’ the render.

    important – you may see an option to use async instead. No theme I have ever seen is set-up to handle async as this loads all the JS in any order and executes it as fast as it can so sometimes it can execute out of order and cause errors (as jQuery may load after something that requires jQuery). defer keeps the order JS files appear in your HTML.

    Removed unused CSS:

    So this is exactly as it sounds.

    Most theme files have hundreds of CSS classes etc. that are just simply not needed to render the page (as there are so many variations to the page design, colour etc.).

    To fix this you would have to find all the styles your theme actually uses (on every page, throughout the whole site, in every state (hovered, visited etc.).

    You would then remove any that aren’t needed anywhere in your site.

    As you can probably imagine this is a monumental task and I would probably just ignore this entirely as this is a really tough one to fix on a theme and requires you to design from the ground up.

    Login or Signup to reply.
  4. Generally:

    • Try to avoid plugins, page builders…

    Your page looks like that you can archive a lot of things with just Gutenberg and a little custom development.

    For the jQuery part:

    • Avoid using jQuery in your custom code
    • Try to configure WP Rocket to
      • load JavaScript deferrred
      • not use the jQuery Safe mode:

    enter image description here

    For the CSS part

    • Try WP Rockets “Optimize CSS delivery”

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search