• Resolved bozzo23

    (@bozzo23)


    i am wondering , why not put an option to put the JS file inside html , inline , when it is short.

    i think it would be faster to read small code from html , than to get it in other file… i think some critical size need to be find.

    but i see many small file in theme or some plugin that just start some basic jquery stuff…

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

    (@optimizingmatters)

    the problem is that linked JS can be cached as to avoid having to be re-downloaded, which would not be the case for inlined JS. moreover the execution of inlined JS is still render-blocking if I remember correctly, so if the code in there would be slow(-ish) for some reason it could slow down the initial rendering of the page.

    moreover if you’re talking “basic jquery stuff” you need jquery to be available, which itself is a linked file and thus render-blocking (the next version of AO CCSS will have an advanced option to try to fix that), which limits the gains you could have from using critical css.

    so from a perf. point of view having all JS autoptmiized and load deferred is still the best option I think ??

    frank

    Thread Starter bozzo23

    (@bozzo23)

    i allready use this little fix ??
    seems to work fine on my system.

    thanks a lot for fast and detailled answer

    and sorry for my broken english

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    seems to work fine on my system.

    great to know Bozzo23, if you want you can already download the upcoming 1.12.0 version from Github & take it out for a spin ??

    thanks a lot for fast and detailled answer

    you’re welcome, feel free to leave a review of the plugin and support here! ??

    and sorry for my broken english

    Pas de soucis, ton Anglais n’est pas mal du tout ??

    Bon weekend!
    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.js in html when short’ is closed to new replies.