Viewing 1 replies (of 1 total)
  • Plugin Author Raul P.

    (@alignak)

    There is an option to specify your cdn domain on FVM, however it doesn’t work when you select the defer for pagespeed insights option. The reason is here: https://developers.google.com/web/updates/2016/08/removing-document-write

    Putting them on the cdn may cause them to not load on slow connections, but it’s fine to use the defer for insights method, if their are on the same domain.

    But more importantly, you seem to have a lot of js files, which is definitely not normal.
    The only time this happens, is when you have a lot of js files that are loaded from external cdn providers.

    ex: if you load 5 js files from your domain, then one from google, then another from your domain, then another from cloudflare, then another 3 from your domain…

    the first 5 would be merged into one,
    the google one would break the series (because order matters),
    the other file on your domain would be minified,
    the cloudflare one would break the series again,
    then the last 3 would be merged again into another file.

    You can probably use the option on FVM to add some of those external domain, so FVM can fetch them and merge them together without breaking the series (thus less files).

    In your case, adding these to the list of allowed merging domains, would probably work.
    cdn.pewpewpew.cc
    s0.wp.com
    ajax.googleapis.com/ajax/libs/webfont/

    Alternatively, you could edit your theme to dequeue those external files and load them locally, instead of from the cdn. The issue here is that FVM tries to keep the order of scripts, and it will split them whenever it finds an external file (doesn’t match your site domain).

    Finally, you could also try the autoptimize plugin, as it’s generally easier to setup if you’re not a designer or have no development skills.

Viewing 1 replies (of 1 total)

The topic ‘Merging external javascript/css files’ is closed to new replies.