crowell / modpagespeed_tmp

Automatically exported from code.google.com/p/modpagespeed
Apache License 2.0
0 stars 0 forks source link

combine_javascript will kill defer_javascript's pagespeed_no_defer attribute #709

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up modpagespeed with combine_javascript and defer_javascript
2. Create web site with two deferred tags right next to each other
3. load in browser

What is the expected output? What do you see instead?
Worst case: Two non-deferred script tags. Best case: One non-deferred script 
tag with both scripts combined

What version of the product are you using (please check X-Mod-Pagespeed
header)?
1.5.27.3-beta

On what operating system?
Linux

Which version of nginx?
1.4.1

Source:
<script src="jquery-ui-1.9.1.custom.js"></script>
<script src="jquery.mobile.router-0.9-git.js"></script>

Compiled:
<script 
pagespeed_orig_src="http://localhost:8080/jquery-ui-1.9.1.custom.js+jquery.mobil
e.router-0.9-git.js.pagespeed.jc.v2Qwm_pS4A.js" type="text/psajs" 
orig_index="4"></script><script type="text/psajs" 
orig_index="5">eval(mod_pagespeed_B6Z4zSmdrm);</script>

Source:
<script src="jquery-ui-1.9.1.custom.js"  pagespeed_no_defer=""></script>
<script src="jquery.mobile.router-0.9-git.js"  pagespeed_no_defer=""></script>

Compiled:
same as above (bug!)

As a workaround, one can cause a flush of the combiner:

Source:
<script src="jquery-ui-1.9.1.custom.js"  pagespeed_no_defer=""></script>
<script></script>
<script src="jquery.mobile.router-0.9-git.js"  pagespeed_no_defer=""></script>

Compiled:
<script src="jquery-ui-1.9.1.custom.js" pagespeed_no_defer=""></script>
<script type="text/psajs" orig_index="4"></script>
<script src="jquery.mobile.router-0.9-git.js" pagespeed_no_defer=""></script>

Original issue reported on code.google.com by robert.b...@goodpoint.de on 28 May 2013 at 11:09

GoogleCodeExporter commented 9 years ago

Original comment by jmara...@google.com on 10 Jun 2013 at 6:24

GoogleCodeExporter commented 9 years ago
This was fixed in r3165. We will now just avoid combining JS files that have 
pagespeed_no_defer set. This will be followed up later with a better approach 
that will allow us to combine scripts that have the same attributes set.

Original comment by j...@google.com on 17 Jun 2013 at 2:27

GoogleCodeExporter commented 9 years ago

Original comment by sligocki@google.com on 24 Jun 2013 at 2:08