• Resolved rudolfl

    (@rudolfl)


    Hi,

    As I am working on optimising my site, I came across an interesting issue. AWS inserts some incline code into page, obscured by using base64 encoding

    https://www.hatsfromoz.com.au/bespoke-green-racing-fascinator-by-fillies-collection-2/

    Now, I am not 100% sure if encoding is done by AWS or one of the optimisation plugins, but question is — why is that JS code is inserted into the head of the site?

    Code adds even listeners, like

    window.addEventListener(‘load’,function(){var awsSearch=document.querySelectorAll(“…

    Being in the head, this JS becomes render-blocking. Is there a reason it can not be moved to the footer? Also, if it is AWS that does encoding, why???

    Thanks

    Rudolf

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

    (@mihail-barinov)

    Hi,

    So encoding for sure is made via some of your plugins.

    About that js – yes, plugin add some when Seamless Integration option is enabled to make search forms look and work fine with Avada theme. But you are right that this can be moved to the footer. I will make these changes in the next plugin release.

    Regards

    Thread Starter rudolfl

    (@rudolfl)

    Thank you

    Would also be good to output it at the very end of all js (use wp_footer hook with low priority). This JS is not really needed until user starts to interact with the page.

    As for base64 encode, this is done by optimisation plugin in order to defer this javascript. “defer” option is only valid is “src” is present, so plugin encodes the inline code in order to change the way it loads. Obviously, addition of encodeing/decoding adds to page processing time. If this code is loaded at the end of the page load, I can exclude it from optimisation, saving few more ms

    Rudolf

    Plugin Author ILLID

    (@mihail-barinov)

    Yes, good points. I will definitely do that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.