Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

combine_javascript will kill defer_javascript's pagespeed_no_defer attribute #709

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

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant