• Resolved bsteinagel

    (@bsteinagel)


    Hello,

    I would like to go through my website and figure which javascript files can be deferred. The problem I’m running into is with minified javascript. The path to minified script doesn’t appear to be static so I’m not able to defer these scripts. As an example, the path to one of my minified scripts is:

    /wp-content/cache/wpo-minify/1594487760/assets/wpo-minify-header-2b3305b7.min.js

    The part of the path in bold appears to change randomly. How do I defer scripts when the path changes?

    Regards,

    • This topic was modified 4 years, 4 months ago by bsteinagel.
    • This topic was modified 4 years, 4 months ago by bsteinagel.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Yes good point, i am seeing this under GT Metrix, is it possible to defer or async the minified files without breaking the site ?

    Also @bsteinagel you may look for a pro website, ask me if you need.

    • This reply was modified 4 years, 4 months ago by futur3int.
    • This reply was modified 4 years, 4 months ago by futur3int.
    • This reply was modified 4 years, 4 months ago by futur3int.
    • This reply was modified 4 years, 4 months ago by futur3int.
    • This reply was modified 4 years, 4 months ago by futur3int.

    Hi there,

    At the moment, the minified files can’t be deferred (the option will be added soon).

    You can use the asynchronous section, which takes the original scripts (not the ones generated by WP-Optimize).

    You can get the file names in the advanced tab:

    Marc.

    Thread Starter bsteinagel

    (@bsteinagel)

    Yes. I think that will be a very beneficial feature to have added. Being able to defer minified script should improve my site scores in GTMetrix. Incidentally, I’m not sure how accurately GTMetrix measures real-world performance compared to other performace tools out there. It seems that it’s awfully hard to get even a decent score with that tool, much less anything close to perfect. But I’m a photographer so my site is very image-intensive too.

    Regards,
    Brad

    Hi Brad,

    GTMetrix is a tool to point out possible improvements, but it’s not always on track with the perceived performance. You’ll sometimes get great scores while the site is slow, or bad scores while the site is fast.

    Some of the things that matter more for photography-heavy websites are a good image compression and lazy loading.

    Best,
    Marc.

    Thanks for starting this discussion! I’m in a similar situation and the information posted above was very useful!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Deferring Minified Javascript’ is closed to new replies.