apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
697 stars 159 forks source link

defer_javascript makes site slower #798

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
site: Site is http://aamjanata.com/, running ngx_pagespeed 1.6.29.5-3346

It has defer_js off now, but used to have it on.  With it on, it is slower than 
the unoptimized site:

http://www.webpagetest.org/result/131002_2K_925670fc2f08685db4a37d59b2643a21/

Turning defer_js off via query-param makes optimization a net win:

http://www.webpagetest.org/result/131002_8C_3293a84182178bde5812fd5c13409b69/

From the defer_javascript test I did, there's a huge mysterious gap in the 
waterfall before the defer_js helper script is loaded: 
http://www.webpagetest.org/result/131002_WS_904d20e2c68cc35763e43be4d9e57ee2/1/d
etails/

It looks from the waterfall like no network activity is occurring then.

Digging into more detailed timing for that run, it looks like during that gap 
there is CSS computation going on, despite the cpu-consumption graph at zero: 
http://www.webpagetest.org/timeline/28/timeline.php?test=131002_WS_904d20e2c68cc
35763e43be4d9e57ee2&run=1

It looks like may be prioritize_critical_css would help load time, and it does, 
but it causes a FOUC.

Original issue reported on code.google.com by jmara...@google.com on 3 Oct 2013 at 12:49

GoogleCodeExporter commented 9 years ago
A slurp of the site is saved in Issue 796.

https://code.google.com/p/modpagespeed/issues/detail?id=796#c3

Also, http://www.webpagetest.org/result/131003_7T_K3E/ has response bodies 
saved.

Original comment by jmara...@google.com on 3 Oct 2013 at 1:48