Hummingbird: File Location of Minified & Combined CSS & JS

Hello,

I'm currently using Hummingbird on my multisite network across several sites and noticed that since minifying and combining JS & CSS occurs on a per site basis, the minified and combined file versions are saved in each, individual sites' upload folder..with each CSS or JS file having a unique file name (unique per site).

Sites on a network might use different themes, plugins, CSS and JS so this makes sense in that case.

However in my case, all of my sites will use the same core theme and plugins. I'm also wanting to selectively "async" & "defer" these combined and minified JS scripts for optimization purposes.

I have custom funtions.php code to handle selectively defering and asyncing JS files, however managing that list given how Hummingbird stores its optimized files isn't going to scale very well as this network of sites potentially grows.

Is there a way to have sites that use the same theme and JS files pull from a shared/global source of the minifed and combined files versioned by Hummingbird? That way the files can be managed (deferred, asynced, placement etc.) once for any sites utilizing them.

A shorter way of thinking of this: is there a way to achieve minification and combination settings at more of a network-wide level (or even theme-wide level) rather than just on a per site basis. Even if they were override options in the network admin. Sort of like what WP-Smush has.

Thanks

  • Rone

    Also note that my method of trying to defer and async script files generated by Hummingbird in my functions.pho file is actually not full-proof given that the file names change based on (I'm assuming) cache clears? i.e.:

    01eb54cb214913534b606c4ab9f56a29.js can become 01eb54cb214913534b606c4ab9f56a29-1.js

    OR

    01eb54cb214913534b606c4ab9f56a29.js can become f2AnyRandomStringOfCharacters31.js

  • Adam Czajczyk

    Hello Rone!

    The way Hummingbird minification works on Multisite doesn't let fetch minified files from a "central place". There'd have to be an additional option for this as otherwise it would sort of "contradict" multisite compatibility idea (ability to minify on "per site" basis) and such a solution would need to be custom developed.

    This means an entirely new feature. It makes perfect sense in my opinion but it would need to be developed from scratch and required some serious changes to the plugin's code. That said, I have moved this thread to our "Features & Feedback" forum so other members of our community could vote for it, thus encouraging our developers to implement it in one of the future versions of the plugin.

    Also note that my method of trying to defer and async script files generated by Hummingbird in my functions.pho file is actually not full-proof given that the file names change based on (I'm assuming) cache clears?

    Yes, this names change and since it does indeed work as a basic "internal cache" those names must be made unique so they wouldn't be "messed up" with other files and would "override" cache when settings are changed.

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.