apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 363 forks source link

Js file appering twice in browser #890

Open gau1991 opened 9 years ago

gau1991 commented 9 years ago

When I open site in Firefox/Chrome I am able to see each Js file is loaded twice in browser.

<script src="http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js+jquery.ui.widget.min.js+jquery.ui.mouse.min.js+jquery.ui.slider.min.js+jquery.ui.position.min.js+jquery.ui.menu.min.js+jquery.ui.autocomplete.min.js.pagespeed.jc.HWJtTZcryj.js"></script><script>eval(mod_pagespeed_duz_ccsVDh);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js'></script>
<script>eval(mod_pagespeed_xZmfTOkhGR);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.widget.min.js'></script>
<script>eval(mod_pagespeed_YP8MsRlIPy);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js'></script>
<script>eval(mod_pagespeed_P5SWZoFOnk);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.slider.min.js'></script>
<script>eval(mod_pagespeed_9EFkSQiN6E);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.position.min.js'></script>
<script>eval(mod_pagespeed_xA28Bxwo6j);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.menu.min.js'></script>
<script>eval(mod_pagespeed_W5uVYzg1_z);</script><script type='text/javascript' src='http://www.example.com/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js'></script>
<script src="http://cdn1.example.com/wp-content/themes/example-2014/js/jquery.cycle2.min.js+jquery.cycle2.carousel.js+jquery.cycle2.center.js+jquery.ui.touch-punch.min.js+rtp-listhub-tracking.js+jqvmap,_jquery.vmap.js.pagespeed.jc.HT7RgrluwL.js"></script><script>eval(mod_pagespeed_ewbQtaiX3$);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jquery.cycle2.min.js'></script>
<script>eval(mod_pagespeed_lTuMJL8_I6);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jquery.cycle2.carousel.js'></script>
<script>eval(mod_pagespeed__E70mb0aqC);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jquery.cycle2.center.js'></script>
<script>eval(mod_pagespeed_RU_0fM$egh);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jquery.ui.touch-punch.min.js'></script>
<script>eval(mod_pagespeed_oWWnB3OGZE);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/rtp-listhub-tracking.js'></script>
<script>eval(mod_pagespeed_316rgAFKOL);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jqvmap/jquery.vmap.js'></script>
<script src="http://cdn1.example.com/wp-content/themes/example-2014/js/jqvmap,_jquery.vmap.world.js+jquery.tinyscrollbar.min.js+rtp-sign-up.js.pagespeed.jc.bbbGLsnnf0.js"></script><script>eval(mod_pagespeed_XBw5dtP_Ko);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jqvmap/jquery.vmap.world.js'></script>
<script>eval(mod_pagespeed_0vmmmMvXtl);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/jquery.tinyscrollbar.min.js'></script>
<script>eval(mod_pagespeed_85bv7I0Z7h);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/rtp-sign-up.js'></script>
<script src="http://cdn2.example.com/wp-content/themes,_example-2014,_js,_rtp-custom-scripts.js+plugins,_gravityforms,_js,_jquery.json-1.3.js+plugins,_gravityforms,_js,_jquery.placeholders.2.1.1.min.js.pagespeed.jc.3jcj16hcsr.js"></script><script>eval(mod_pagespeed_3dnCrDiPbc);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/themes/example-2014/js/rtp-custom-scripts.js'></script>
<script>eval(mod_pagespeed_QBshMx1CBS);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/plugins/gravityforms/js/jquery.json-1.3.js'></script>
<script>eval(mod_pagespeed_ixdqwVRH$3);</script><script type='text/javascript' src='http://cdn2.example.com/wp-content/plugins/gravityforms/js/jquery.placeholders.2.1.1.min.js'></script>
<script type='text/javascript' src='http://cdn2.example.com/wp-content/plugins/gravityforms/js/gravityforms.js'></script>

In this I am able to see that, each JS is loaded twice in code. Following filters enabled on my pagespeed configuration:

pagespeed EnableFilters combine_javascript,rewrite_javascript;
jeffkaufman commented 9 years ago

What does the original html for your script includes look like?

gau1991 commented 9 years ago

Original content are as follows:

<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.widget.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.slider.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.position.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.menu.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jquery.cycle2.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jquery.cycle2.carousel.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jquery.cycle2.center.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jquery.ui.touch-punch.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/rtp-listhub-tracking.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jqvmap/jquery.vmap.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jqvmap/jquery.vmap.world.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/jquery.tinyscrollbar.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/rtp-sign-up.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/themes/example-2014/js/rtp-custom-scripts.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/plugins/gravityforms/js/jquery.json-1.3.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/plugins/gravityforms/js/jquery.placeholders.2.1.1.min.js'></script>
<script type='text/javascript' src='http://example.com/wp-content/plugins/gravityforms/js/gravityforms.js'></script>
jeffkaufman commented 9 years ago

The original html looks completely reasonable.

It looks like the js is getting put in the html twice: once as the output of combining and once as a single file.

Do you have any other pagespeed settings in your config?

Can you share a link to your site?