• Resolved disagree

    (@disagree)


    Not sure if I’m missing something – but after switching from autoptimize to pegasaas – all the .js scripts are not being combined into 1 ( or few ) files, which increased the pingdom tools “amount of files loaded” value by a big factor.

    I’m also not able to find an option that’s called “combine js” – only “combine css”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pegasaas

    (@pegasaas)

    Hey @disagree

    Thanks so much for taking the time to share your thoughts.

    You are quite correct. In the the Standard Edition / Guest API, combine JS is not currently one of the available features. I’ll explain why.

    When combining JS, one option is to inject the entire JavaScript into the body of the page which causes a much larger initial document. While this means that the JS will parse early, it also means that the JS will not be cached and so every page load will be longer.

    The other option is to bundle all of the JS (including inline) into a separate file, and then make a single call to that file at the end of the document. Unfortunately, browser caching of this file will only affect subsequent loads of the home page, and the parsing and execution of the JS is delayed. I believe this is how Autoptimize does it.

    When JS is not combined, but deferred properly, the JS files can be properly cached so that on any subsequent page request, all JS is available immediately. Also, it means that the JS will execute in order which will often mean the above-the-fold content will render faster.

    I agree, having many JS requests is reported as an issue with tools such as Pingdom and GTMetrix, however we always have to consider the larger scope of what is going on in the page as well. And, with HTTP2 being supported by more and more web hosts, many of those resource requests can be loaded in parallel which have a faster load time than if the JS were in a single combined file. Having JS combined by default may have been a feature that we would have considered enabled by default a few years back, but not so much now. In addition, we’ve found that when combining JS, the JS can have troubles parsing in some sites.

    When I developed Pegasaas, I felt it was more important to make a plugin that applied the “best case” scenario without requiring features to be turned off or on. The Guest API access is designed so that it’s a “one and done”.

    But, I admit, there are those websites that may respond better with more expert level configurations. We do have a premium version which allows for more fine-grained configurations, although the ability to combine JS is not a separate feature at this time but is actually a part of an advanced version of deferral of render blocking JS resources.

    But I will consider having the JS combination broken out into it’s own feature though — for those who feel it will have a better impact on their site.

    Again, I appreciate you taking the time to share your observations.

    Best regards,
    Brandon Devnich
    Pegasaas

    • This reply was modified 5 years, 5 months ago by Pegasaas.
    Thread Starter disagree

    (@disagree)

    I think I understand your point – my issue is just having themes and plugins that inject so many separate .js files. I’d at least like to have them grouped, instead of having 50 separate https requests because of included .js files. That is also blocking.

    I’m used to js combiners grouping 10-20 files at once, so they still can be loaded in parallel.

    The difference ( in my case ) on pingdom is 143 request with Pegasaas vs 72 requests with autoptimize.

    ( And no, I wouldn’t want to inline js )

    If PegaSaaS doesn’t support this, then a plugin like autoptimize ( or similar ) should be allowed to co-run with it, just for this purpose. Right now that doesn’t seem to be possible.

    Thanks for your quick and thorough response!

    Plugin Author Pegasaas

    (@pegasaas)

    It sounds like you consider this an important feature and I can see where in some situations it could be beneficial so I’ll look at adding it to the plugin over the next week or so.

    Thanks so much for your viewpoint.

    Plugin Author Pegasaas

    (@pegasaas)

    Hello @disagree

    Just wanted to let you know that version 2.6.0 is now available, and it includes the Combine JS feature.

    Thank you so much for your input and feature suggestion!

    Kind Regards,
    Brandon Devnich
    Pegasaas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Combine JS’ is closed to new replies.