[Hummingbird] Assets optimization per page

I have seen other plugins that gives the option to optimize assets based on page/url. This will make it possible to create highly optimized version of the startpage and other high traffic pages.

  • Dimitris
    • Support Star

    Hello there Kjetil Wikestad,

    hope you're doing well and appreciate the request here. :slight_smile:

    Even though the Asset Optimization can become an intimidating task due to the trial&error nature that requires to fine tune it, I understand the need on this.
    I've already shared it with our developers and designers for further consideration. Me or another colleague of mine will keep you posted here about any development on this. :slight_smile:

    Thank you,
    Dimitris

  • Andy
    • Product Design Lead

    Kjetil Wikestad this sounds like an interesting option... From my understanding of how the Asset Optimization works in Hummingbird, it will optimize each page as per your settings. So, if you have 100 files and you configure how you want them all to behave, Hummingbird will then server each page as per those settings. I.e. your homepage's optimized file structure will be different to a product page if they have different files being enqueued.

    Does that make sense? Quite hard to explain! But in essence, Hummingbird *does* already do per-page optimization as per your settings.

    • Kjetil Wikestad
      • ProDev

      Hi, Andy!

      My experience is that most plugins just queues all resources without checking if it is needed on a particular page.

      For instance Elementor will load assets files for all widgets even if you only use a small subset of widgets.

      The other real world example I have experienced is jquery widgets that are used by several different plugins. I had a problem with select2 that was used by Forminator, Elementor and Ultimate Member. They all used conflicting styling and versions and I could not get them all to work at the same time. So what I wanted was to use select2 from Forminator on the startpage and select2 from Ultimate Member on the user page.

      • Dimitris
        • Support Star

        This is more of an issue of each plugin, as it should be using its assets only in pages/endpoints that are actually needed, so for any similar case please do report that to the corresponding developers. :slight_smile:

        Was this ever reported about Forminator? Cause I don't see any thread of yours around this topic.

        Warm regards,
        Dimitris

        • Kjetil Wikestad
          • ProDev

          Trying to convince every plugin and theme author to comply to best practices sounds like an uphill battle into eternity. It is not realistic to think that this will ever happen. Sure, I could commit bug reports and change plugins, but a feature like this would be a shortcut to get a site to work great in a matter of minutes. And is that not the task of wmpudev, make us developers/designers/users look good?

          • Andy
            • Product Design Lead

            Kjetil Wikestad We could possibly provide the means to do this, though I am weary that we will get more complaints from people than praise. It could very easily stop important pieces of plugins from working if we are removing files that are required for it to work. It's a tough one, I do understand that it's a waste of resources to load scripts/css that aren't needed on every page - but I do agree with Dimitris that this really should be handled in the plugin itself.

            I will ping our lead dev and see if he has a way you can achieve this for your sites :slight_smile:

            Cheers,
            Andy

          • Kjetil Wikestad
            • ProDev

            Thank you for considering this!

            I think your argument about complaints from users is a moot point, because you can still do this today, disable files that plugins depends on. The only difference would be that I as a user have better control on which pages the files should be disabled on.

          • Andy
            • Product Design Lead

            Kjetil Wikestad I have discussed this with our lead dev and he has said it's technically possible to do, but would involve quite a sizeable refactor of code to allow for it. I would say it's safe to say we won't be looking to support this in the super near future, but, I will pop it in the backlog to revisit soon.

            In the mean time, see what you can do by contacting plugin devs. Often there will be filters to control the enqueuing of scripts to give you a bit more freedom. You could even create a little mu-plugin to re-use on multiple sites that prevents scripts loading on pages that don't need it.

            Good luck!
            Andy

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.