• Resolved reshampanth

    (@reshampanth)


    Hi Frank,
    I have been trying to test my page speed on GTmetrix but due to some reasons I get an incomplete scan. I contacted support and they told me that an auto-optimiser on your website fires the window.onload event and javascript loads after that. Hence Gtmetrix does not scan the entire website.
    Any idea how to fix this? I tried disabling autoptimize and scan but it still fails so most probably ts not autoptimize problem but since the supprt clearly said ” I see your site uses an auto-optimizer “, I thought I should talk to you..
    Thanks,
    Resham Panth (https://sprybag.com)

    https://wordpress.org/plugins/autoptimize/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Afternoon Resham;
    The only instance where AO uses window.load (as a fallback for domContentLoaded event) explicitly is when you’re “inline&defer”-ing CSS, which you are not. Now when JS is not forced in head, the JS is loaded with the “defer”-flag, that might have an impact (ticking the “force JS in head”-option fixes that, but JS is better not forced in head, so …).

    But most importantly; you’re using cloudflare’s rocketloader, that would be my first suspect really 🙂

    Have fun,
    frank

    Thread Starter reshampanth

    (@reshampanth)

    Hi Frank,
    Sorry for the late reply, stuck with exams here.
    I tried “Force JS in Head”, tried disabling rocketloader, tried disabling cloudflare. Gtmetrix still doesn’t give me anything..
    Also I have this ‘Reduce server response time’ error in pagespeed insights. Anything that might help fix that other than changing my webserver? I am on hostgator shared plan for now and can’t afford dedicated right now!
    Cheers,
    Resham Panth

    Plugin Author Frank Goossens

    (@futtta)

    regarding window.onload; no idea in that case, really. if JS is forced into head and if rocketlauncher is off, the only remaining possibility is you have code inside the optimized JS which fires upon window.load?

    regarding reduce server response time; generally you’d want a page caching plugin (e.g. wp super cache or hypercache or comet cache or …) to help you with that.

    frank

    Thread Starter reshampanth

    (@reshampanth)

    I am using W3 total cache for that. Don’t see any improvement. Still get the error

    Plugin Author Frank Goossens

    (@futtta)

    then I would try with one of the many alternatives really. wp super cache maybe?

    Thread Starter reshampanth

    (@reshampanth)

    The reason why I dont want to switch from W3TC is the option to use a subdomain to serve static resources. Did not find that in any other plugin

    Plugin Author Frank Goossens

    (@futtta)

    well, WP super Cache has “cdn”-support, which is essentially the same thing as far as I can tell 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Firing window.onload event on GTmetrix’ is closed to new replies.