Hello @brianporter
I hope you are doing well!
I’ve forwarded your suggestion to our developers, although am afraid the plugin was designed this way. The JS file is very large and it not advisable to load it inline.
Let us know if you have any further questions!
Kind regards,
Nastia
Hi Nastia,
Thanks for passing this along. I understand your thought on the JS file size, but actually the browser is going to load the same amount of bytes either way. Its just whether its loading it on initial file load or having to do an HTTP request and then load it. We’re also using the WPMU DEV hosting and it is set to gzip the html doc on delivery, so we’re actually seeing a lot of benefits to writing things inline that reduces total file size transferred. Another thought, we looked at using Hummingbird by WPMU DEV to combine and inline the files, which is its main purpose, but it gets tricky to know the right sequence and what can and can’t be combined given the Forminator is also writing a lot of inline JS as well.
Let me know if the developers think they will put this on the roadmap or not, otherwise I may need to code a different solution for our use case.
Thanks
Brian
Hi @brianporter
I hope you’re well today!
Actually, Hummingbird was exactly what I was about to suggest. It’s “Asset Optimization” can do just that and “inline” selected CSS. It can also do much more, like additionally compress (minify) it, combine multiple files into less number of bigger files and so on.
It can be tricky to set it up, yes, but it’s not that “tricky” as it might seem at first. There’s no “sequence” or order (as there’s no way to manually affect order of compressing/inlining/combining/loading those assets in the plugin) and the recommended process – although might seem a bit “lame” at first and can take quite some time – is actually pretty simple:
– switch Asset Optimization to “Advanced mode”
– recheck files to get an up to date list of assets
a) enable all the buttons (except for “don’t load”; it’s rarely useful and it stops selected asset from being loaded at all) for first 2-3 files on the list; publish changes
b) browse the site for a while to see if it’s working fine; if not, literally “experiment” with combination of those buttons for those 2-3 files until you manage to get as many of them enabled as possible while keeping the site fully operational/functional
c) repate a-b with next 2-3 files on the list and so on until you reach the end of the list.
The biggest challenge here is that it takes a bit of testing to make sure that enabled options don’t break the site and if they do, to adjust (though it’s really a “try and adjust” type of task) them to keep things working. It’s not fully automated because only human can fully asses (preferably somebody who knows the site “inside out and back”) if everything is looking and working as it should. But other than this (and being a bit time-consuming) there’s not much more into it.
Best regards,
Adam
Hello @brianporter
I hope you are doing well!
We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.
Kind regards,
Nastia