• Hello,

    I was wondering if Autoptimize somehow allows optimising (minifying and concatenating) Javascript files in the head independently from the Javascript files in the footer, as the wp_enqueue_script last argument $in_footer suggests?

    It seems that right now the optimised files will either be output all in the footer or all in the head. However, the $in_footer argument of wp_enqueue_script allows developers to declare whether they need a Javascript file in the head or in the footer.

    So, I guess it would be nice if Autoptimize could follow this pattern and produce two different and independent Javascript optimised (minified and concatenated) files, one for the head and one for the footer, as the $in_footer argument of wp_enqueue_script suggests.

    Thanks in advance!

    Cheers,
    Takis

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    no, I’m afraid AO puts all JS in the footer and defers it, all for the purpose of allowing the page to render asap (which would not be the case if JS was left in the header un-deferred).

    hope this clarifies,
    frank

    Thread Starter Takis Bouyouris

    (@nevma)

    Hello, Frank,

    Thank you for the prompt reply!

    I understand this is what AO does at the moment, but I wasn’t expecting this to be obligatory. WordPress developers do have the option to actively declare which scripts they need in the head and which other can be deferred to the footer. So, I guess I was hoping this would be respected by AO.

    Perhaps this could be a nice future addition to its features.

    Cheers,
    Takis

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    It already is on the (long) list of things to consider, but no promises ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Concatenate and minify Javascript files in header and footer independently’ is closed to new replies.