• Resolved Sanjay

    (@rsclmumbai)


    Hi,

    What is the simplest way to add “async” tag to JQuery.
    I’ve access to the PHP code and I can play around a bit with it if it helps.
    This is required for google page speed.
    Thanks

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    Only adding “async” to jQuery will cause errors with the 2 blocks of inline script that rely on jQuery @rsclmumbai … but maybe try the “async javascript”-plugin?

    An alternative could be to tick the “also aggregate inline js”-option and then remove js/jquery/jquery.js from the list of JS optimization exclusions (and add wordfence_logHuman to avoid the wordfence inline JS from breaking your AO JS cache)?

    frank

    Thread Starter Sanjay

    (@rsclmumbai)

    Thank Frank, will try the inline option; couple quick question before I do.

    1. Does the order in which JS are inlined matter? Or does AO inline JS in the order they are setup on the webpage.
    2. Does inlining jS have any negative SEO impact?

    Thanks,

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    1. AO indeed keeps the order the scripts are found in
    2. no ??

    Thread Starter Sanjay

    (@rsclmumbai)

    Thanks Frank!! Its looking good.

    GTMetrix:
    A PageSpeed Score: 94%
    B YSlow Score: 83%
    TTFB: 117ms
    PageSpeed: 71/89

    CSS files are the only hurdle. Not sure why AO is creating 2 css files (combined, minified). If you could take a quick look at my website and suggest solution, I would get a perfect score.

    Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Not sure why AO is creating 2 css files (combined, minified).

    because your original CSS will have files with media=”all” and some with e.g. media=”screen” and AO honors those, resulting in 2 files, one for each media-type. you _could_ use the API to enforce them all to media=”all” (example code for a slightly different use case here), but that _could_ break stuff as well ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘What is the simplest way to add “async” tag to JQuery’ is closed to new replies.