New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combine_javascript will kill defer_javascript's pagespeed_no_defer attribute #709

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 3 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

  • Changed state: Fixed
  • Added labels: Milestone-v28
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

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

  • Added labels: Milestone-v29, release-note
  • Removed labels: Milestone-v28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment