Closed (cannot reproduce)
Project:
Advanced CSS/JS Aggregation
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Sep 2017 at 06:07 UTC
Updated:
28 Oct 2017 at 04:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
karamveersingh commentedComment #3
mikeytown2 commentedTurn off "Deferred CSS Execution: Use JS to load CSS". That's a difficult to get working correctly. Also what does your status report say under advagg admin/reports/status?
Comment #4
karamveersingh commented@mikeytown2 Thank-You for quick response, I applied your suggested changes.
Q:Also what does your status report say under advagg admin/reports/status?
Ans: Please see attached screenshots(AdvAgg-screen 7,8,9),hope that helps.
Let me know if anything required from my end?
Comment #5
mikeytown2 commenteda zero being returned for the gzip test might be something but it's hard to tell.
Can you send me a HAR of the site when it's really slow to load?
https://community.box.com/t5/Managing-Content-Troubleshooting/How-to-Gen...
Another way is to send me the output from http://www.webpagetest.org/
This should list out what files are slow to load.
Comment #6
karamveersingh commentedAnother way is to send me the output from http://www.webpagetest.org/
Ans:http://www.webpagetest.org/result/170902_JG_b9da10856d9b2375da22a5ed8f67...
Can you send me a HAR of the site when it's really slow to load?
Ans:please find attached file,har extension not allowed hence uploaded with .txt extension.
Comment #7
mikeytown2 commentedI haven't looked at the har file but js minification can cause issues as well. Try disabling that as well.
Comment #8
mikeytown2 commentedwebpagetest can't connect due to a SSL issue. The HAR file shows that it takes about 3-4s to get the HTML out and I don't see any issues with CSS or JS loading. On admin/config/development/performance/advagg what's the AdvAgg Cache Settings set to?
Comment #9
karamveersingh commentedthank-you @miketown2 , please see attached AdvAgg cache settings screenshot.
On admin/config/development/performance/advagg what's the AdvAgg Cache Settings set to?
Ans:Aggressive Render Cache ~ 10ms
webpagetest can't connect due to a SSL issue
Ans: Please see this report -generated with development domain ,hope this will help for finalize the issue ->https://www.webpagetest.org/result/170904_VR_619603f953a47787853262d14bd...
Thanks,
Karamveer
Comment #10
mikeytown2 commentedWebpagetest is showing a "Connection: close" header for your domain. This is an apache setting that is really hurting your sites performance. It should be "Connection: keep-alive", this has nothing to do with AdvAgg though; it's an apache setting. Furthermore I don't see anything from the webpagetest output that points towards AdvAgg causing a slowdown. I think you are looking for general webpage speed support which I will not be providing here, only help as it pertains to AdvAgg.
Comment #11
karamveersingh commentedthanks for your messages, I've tested live domain without https over webpagetest tools and downloaded HAR file, could you please check the attached HAR file and suggest me what else in the AdvAgg settings.
Comment #12
mikeytown2 commentedhttps://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2...
You'll need to gzip svg
https://stackoverflow.com/questions/36821563/cant-compress-svg-with-gzip
Compress this PNG with something like https://pngquant.org/ and/or https://tinypng.com/
http://veracodedev.prod.acquia-sites.com/sites/all/themes/veracode/img/p...
Use advagg relocate module's "Move external JS files to a local JS file" in conjunction with "Move inline google tag manager inline gtm.js loader code to drupal_add_js".
These 3 things should get you a 100/100
Comment #13
karamveersingh commentedthanks for the updates but problem still exist on development server, pages are not loaded its just buffering.I tried all ways like disabled one by one AdvAgg each options then also disabled other modules like colorbox,mollom no any success.
Confirming in sites/default/files/advagg_js & sites/default/files/advagg_css files are stored with .htaccess.
Comment #14
mikeytown2 commentedDoes the page load if advagg is disabled? add
?advagg=-1to the url to test.Comment #15
karamveersingh commentedsorry for late reply,Yes its loaded perfectly If I pass ?advagg=-1 as query string to the URL.
Comment #16
mikeytown2 commentedWhat about ?advagg=0
Comment #17
karamveersingh commentednot loaded, just buffering the page...
Comment #18
mikeytown2 commentedWhat about this
?advagg=-1&advagg-core=1and this
?advagg-core=0Comment #19
karamveersingh commentedIf I try with this URL?advagg=-1&advagg-core=1 then page loaded smoothly but not with this ->URL?advagg-core=0
Comment #20
mikeytown2 commentedUninstall all AdvAgg sub modules and try again.
Comment #21
karamveersingh commentedYes now its working fine,only one module enabled which is ->Advanced CSS/JS aggregation, see attached screenshot(AdvAgg-Screen-11.png).
Comment #22
mikeytown2 commentedEnable and configure one at a time in order to better isolate the issue
Comment #23
karamveersingh commentedthanks, I enabled AdvAgg Modifier plugin/module and issue arise.Site taking huge time for load.
Comment #24
mikeytown2 commentedIs it any setting that does it or with all the settings at default (off) does it do it?
Comment #25
karamveersingh commentedthanks for your reply
Is it any setting that does it or with all the settings at default (off) does it do it?
Answer: no any changes used default, I further troubleshoot and noticed If I does a view source, the markup looks intact. If one watches the "Elements" pane, the markup goes from normal to just this:
"script src="/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery-ui.min.js"
I searched the modules and by-force removed /commented
jquery_update_jqueryui_backup function in the jquery_update/jquery_update.module.php file, then issue resolved and every page loaded perfectly.
Please let me know why "jquery_update_jqueryui_backup " hook creating issue?
thanks
Comment #26
mikeytown2 commentedWhat version of the jquery_update module are you using (7.x-2.x or 7.x-3.x)? Settings for Default jQuery version; jQuery compression level; jQuery and jQuery UI CDN; jQuery Migrate?
Comment #27
mikeytown2 commentedIs this checked on your setup?
admin/config/development/performance/advagg/mod -> JS -> Adjust javascript location and execution -> Experimental Settings -> "Defer CDN version of jquery.js from jquery update"
Comment #29
mikeytown2 commentedI've added in some code to handle jquery migrate. Don't think this will fix it but it prevents js errors that I get in the console (Ctrl+Shift+K or Ctrl+Shift+J) when using that option in jquery update.
Comment #30
karamveersingh commentedthanks Mikey for your response, I followed each instructions and below is my comments.
What version of the jquery_update module are you using (7.x-2.x or 7.x-3.x)? Settings for Default jQuery version; jQuery compression level; jQuery and jQuery UI CDN; jQuery Migrate?
Answer: I am using Version: 7.x-2.7 , regarding other settings please see attached screenshot(AdvAgg-Screen-12.png)
Is this checked on your setup?
admin/config/development/performance/advagg/mod -> JS -> Adjust javascript location and execution -> Experimental Settings -> "Defer CDN version of jquery.js from jquery update"
Answer: No see attached screenshot(AdvAgg-Screen-13.png), but
options is checked do I need to disable that?
I've added in some code to handle jquery migrate. Don't think this will fix it but it prevents js errors that I get in the console (Ctrl+Shift+K or Ctrl+Shift+J) when using that option in jquery update.
Answer: Please confirm do I need to apply this patch or not ?
Comment #31
mikeytown2 commentedI don't think you need the patch. I'll match your jquery update settings tomorrow and see if any issues bubble up when doing so.
It's worth trying the experimental setting; this is actually a workaround for the jquery backup function so it works better when using defer js loading. I should make this a hidden setting (so it can still be forced off) and auto detect if the right conditions are met for turning it on.
Comment #32
karamveersingh commentedthanks
Comment #33
karamveersingh commentedmiketown : AdvAgg plugin working fine but Score on Google Page speed little bit improved , its still prompted 11 js/css render-block files.
Could you please guide my what more we can do, for more clarification see attached page-speed screenshot(AdvAgg-Screen-14-1.png)
Comment #34
mikeytown2 commentedCan you test this out? See if this fixes the issue for you.
Comment #35
mikeytown2 commentedIn terms of google page speed you should use the advagg font module; that should make fonts non blocking.
Using advagg_relocate will also be needed for fonts. By default it can take care of the CSS request for https://fonts.googleapis.com/.
I haven't implemented font handling for https://www.typography.com/ yet so that'd be a new issue; and it might not be possible with their current model of how the CSS for the font is delivered.
https://twitter.com/cloudtypography/status/540906824569217024?lang=en
https://www.tollmanz.com/typography-coms-cssom-blocking-font-loader/
https://cdnjs.com/libraries/font-awesome can easily be handled by advagg_relocate; the css file contains all the rules needed and doesn't require anything special.
The last 2 CSS files are local so they need to be included into the css array so that drupal knows about it (drupal_add_css) and preprocess = TRUE.
advagg_relocate will take care of modernizr.js; jquery & jquery ui don't use a CDN; last 2 js files are local so they need to be included into the js array so that drupal knows about it (drupal_add_js) and preprocess = TRUE.
Comment #36
karamveersingh commentedthanks mikey
I applied your suggested patch(https://www.drupal.org/node/2906290#comment-12268145) , also re-enabled jquey options on AdvAgg settings(https://www.drupal.org/files/issues/AdvAgg-Screen-15.png).
With your patch issue - #25(https://www.drupal.org/node/2906290#comment-12262594) fixed/resolved but Tb-mega menu not working(https://www.drupal.org/files/issues/AdvAgg-Screen-15-2.png).
See attached screenshot of recently applied settings as well as some js errors those(https://www.drupal.org/files/issues/AdvAgg-Screen-15-1.png) are prompted after apply the patch.
Thanks,
Karamveer Singh
Comment #37
mikeytown2 commentedThis should take care of the js error that was in the console.
Comment #38
karamveersingh commentedI applied new patch and noticed function
changes not exist in my advagg_mod.module.php file, see below copy of existing running function.
Note: Unable to find this changes-> - $values['onerror'] .= 'advagg_fallback(' . $jquery_migrate_fallback . ');';
+ $values['onerror'] .= "advagg_fallback('{$jquery_migrate_fallback}');";
/**
* Add the defer and or the async tag to js.
*
* @param array $js
* JS array.
*
* @return bool
* TRUE if jQuery is defered.
*/
function advagg_mod_js_async_defer(array &$js) {
$jquery_defered = FALSE;
// Return early if this is disabled.
list(, , $no_async_defer_list, $inline_wrapper_list, , , , , $defer_setting, $async_setting) = advagg_mod_get_lists($js);
if (!$defer_setting && !$async_setting) {
return $jquery_defered;
}
// Disable this section of code for now; the on error attribute only works
&$values) { // Skip if not a file or external. if ($values['type'] !== 'file' && $values['type'] !== 'external') { continue; } // Everything is defer. if (variable_get('advagg_mod_js_defer', ADVAGG_MOD_JS_DEFER)) { $values['defer'] = TRUE; } // Everything is async. if (variable_get('advagg_mod_js_async', ADVAGG_MOD_JS_ASYNC)) { $values['async'] = TRUE; } // Special handling for jQuery. if (stripos(strrev($name), $jquery_rev) === 0 || stripos(strrev($name), $jquery_min_rev) === 0 ) { $jquery_defered = TRUE; // Do not fire jQuery.ready until Drupal.settings has been defined. $values['onload'] = "if(jQuery.isFunction(jQuery.holdReady)){jQuery.holdReady(true);}"; // jquery_update fallback. if (module_exists('jquery_update') && variable_get('jquery_update_jquery_cdn', 'none') !== 'none') { if ($use_on_error) { if (!isset($values['onerror'])) { $values['onerror'] = ''; } //$values['onerror'] .= 'advagg_fallback(\'' . $jquery_update_fallback . '\');'; $values['onerror'] .= "advagg_fallback('{$jquery_update_fallback}');"; } // Do not defer/async the loading of jquery.js. /*if (!variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY)) {*/ if (!variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY) !== FALSE && variable_get('advagg_mod_js_defer_inline_alter', ADVAGG_MOD_JS_DEFER_INLINE_ALTER) && variable_get('jquery_update_jquery_cdn', 'none') !== 'none' ) { if (variable_get('advagg_mod_js_defer', ADVAGG_MOD_JS_DEFER)) { $values['defer'] = FALSE; $jquery_defered = FALSE; } } if (variable_get('advagg_mod_js_async', ADVAGG_MOD_JS_ASYNC)) { $values['async'] = FALSE; } // Defer/async is off; done with loop. continue; } } // Special handling for jQuery UI. if (stripos(strrev($name), $jquery_ui_rev) === 0 || stripos(strrev($name), $jquery_ui_min_rev) === 0 ) { // jquery_update ui fallback. if (module_exists('jquery_update') && variable_get('jquery_update_jquery_cdn', 'none') !== 'none') { if ($use_on_error) { if (!isset($values['onerror'])) { $values['onerror'] = ''; } $values['onerror'] .= 'advagg_fallback(' . $jquery_update_ui_fallback . ');'; } // Do not defer/async the loading of jquery-ui.js. /*if (!variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY)) {*/ if (!variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY) !== FALSE && variable_get('advagg_mod_js_defer_inline_alter', ADVAGG_MOD_JS_DEFER_INLINE_ALTER) && variable_get('jquery_update_jquery_cdn', 'none') !== 'none' ) { if (variable_get('advagg_mod_js_defer', ADVAGG_MOD_JS_DEFER)) { $values['defer'] = FALSE; } } if (variable_get('advagg_mod_js_async', ADVAGG_MOD_JS_ASYNC)) { $values['async'] = FALSE; } // Defer/async is off; done with loop. continue; } } // Drupal settings; don't run until misc/drupal.js has ran. if ($name === 'misc/drupal.js') { // Initialize the Drupal.settings JavaScript object after this has // loaded. if (!isset($values['onload'])) { $values['onload'] = ''; } $matches[0] = $matches[2] = 'init_drupal_core_settings();'; $values['onload'] .= advagg_mod_wrap_inline_js($matches, "window.init_drupal_core_settings && window.jQuery && window.Drupal", 1); } // No async defer list. foreach ($no_async_defer_list as $search_string) { if (strpos($name, $search_string) !== FALSE) { // Do not defer/async the loading this script. if (variable_get('advagg_mod_js_defer', ADVAGG_MOD_JS_DEFER)) { $values['defer'] = FALSE; } if (variable_get('advagg_mod_js_async', ADVAGG_MOD_JS_ASYNC)) { $values['async'] = FALSE; } } } // Do not defer external scripts setting. if ($defer_setting == 2 && $values['type'] === 'external') { $values['defer'] = FALSE; } } unset($values); // Inline script special handling. foreach ($js as &$values) { if ($values['type'] !== 'inline') { continue; } foreach ($inline_wrapper_list as $search_string => $js_condition) { if (strpos($values['data'], $search_string) !== FALSE) { $matches[0] = $matches[2] = $values['data']; $values['data'] = advagg_mod_wrap_inline_js($matches, $js_condition); } } } unset($values); return $jquery_defered; }// with async safe JS.
$use_on_error = FALSE;
/*if (variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY)) {*/
if (variable_get('advagg_mod_js_defer_jquery', ADVAGG_MOD_JS_DEFER_JQUERY) !== FALSE && variable_get('advagg_mod_js_defer_inline_alter', ADVAGG_MOD_JS_DEFER_INLINE_ALTER) && variable_get('jquery_update_jquery_cdn', 'none') !== 'none' ) {
$use_on_error = TRUE;
}
// If everything is async safe then we can use on error.
// Only needed if the jquery_update javascript is loaded via async/defer.
if ($use_on_error) {
$jquery_update_fallback = '';
$jquery_update_ui_fallback = '';
$inline_array = array();
if (module_exists('jquery_update') && variable_get('jquery_update_jquery_cdn', 'none') !== 'none') {
foreach ($js as $name => &$values) {
if ($values['type'] !== 'inline') {
continue;
}
if (stripos($values['data'], 'window.jQuery.ui') !== FALSE
&& stripos($values['data'], 'document.write("
Comment #39
mikeytown2 commentedApply the patch on top of the latest dev version.
Comment #40
karamveersingh commentedI am using Version: 7.x-2.26 Is this patch not work on this version? Also after apply your changes tb-mega menu still not working listing this js error.
ReferenceError: advagg_fallback is not defined
about (line 1, col 1)
ReferenceError: Shadowbox is not defined
Note: In the settings this option is checked -> Deferred JavaScript Execution: Add The defer Tag To All Script Tags : All but external scripts
Comment #41
mikeytown2 commentedAll patches are usually written for the dev version.
is a new error; I'll look into that in about 12hrs.
Comment #42
karamveersingh commentedOk, Is those not work with Version: 7.x-2.26 ? Can I revert the changes whatever I applied please confirm.
Assignment going to delayed I need to finalize this plugin work or not.
Comment #44
mikeytown2 commentedError introduced here http://cgit.drupalcode.org/advagg/commit/?id=781dac2fa2e51536eb17f17e2fe...
This patch has been committed and should fix it.
Comment #46
mikeytown2 commentedComment #48
mikeytown2 commentedI've committed #37; this should fix the issues for you.
Comment #50
karamveersingh commentedHello Mikey,
Sorry for late, I'm back again with a issue - recently some customer reported website not working showing WSOD on Microsoft Edge - Version 14,15
I troubleshoot the issue and noticed in the source of page its showing -> jquery undefined error(https://www.drupal.org/files/issues/AdvAgg-Screen-16-1.png) and in source minified jquery-ui path (https://www.drupal.org/files/issues/AdvAgg-Screen-16-2.png)
I applied your latest patches (https://www.drupal.org/node/2906290#comment-12272395) but not succeed, could you please guide me solution/fixing?
Note: Its the same case as earlier reported see this https://www.drupal.org/node/2906290#comment-12262594
Thanks,
Karamveer Singh
Comment #51
mikeytown2 commentedComment #52
mikeytown2 commentedCan I get a har file of the page in question?
https://toolbox.googleapps.com/apps/har_analyzer/
Comment #53
karamveersingh commentedplease find attached required HAR file(https://www.drupal.org/files/issues/advgAgg-har%20-16-Oct-2017.txt) and suggest me appropriate solution.
Comment #54
mikeytown2 commented404 for a .map file isn't an issue; See https://stackoverflow.com/questions/18365315/jquerys-jquery-1-10-2-min-m... for an explanation. I used http://www.softwareishard.com/har/viewer/ to look at the har. If this was not the issue please upload a new har file that contains the issue.
Comment #55
karamveersingh commentedthanks for your inputs,could you please tell me which map library I can download from the reference link?
Also why its throwing 404 error even its part of AdvAgg plugin? We didn't added any our custom work in AdvAgg plugin.
FYI, in the source of page just showing this ->
Comment #56
mikeytown2 commentedCan you save the page https://support.mozilla.org/en-US/kb/how-save-web-page and then zip that up and upload it here so I can take a look?
Comment #57
karamveersingh commentedplease find attached required page-source in zip, please make note I saved page from mozilla where we don't have any issue.
On MS-Edge unable to save the page, let me know if you want page-source from MS-Edge browser?
Comment #58
mikeytown2 commentedI can reproduce the issue in IE. If you wait 5 minutes it will load
Comment #59
mikeytown2 commentedLoading it from 127.0.0.1 vs file:/// and it's slow but not crazy slow.
Used https://gist.github.com/craigds/00331c6ff8fd2334de68a52ef0cd79c2 and the custom php code at the bottom to convert xml to har. I don't see a smoking gun here; page is slow and js is blocking the rendering but it's not WSOD.
Comment #60
mikeytown2 commentedAlso got these console errors. The Extra "" tag found error is something to look into fixing as well as the CORS (Cross Origin Resource Sharing) issues with the XMLHttpRequests
Comment #61
karamveersingh commentedthanks for your answers/explanation could you please assist me what else need to do from my end? sorry in advance if I misunderstand your point.
Comment #62
mikeytown2 commentedStart by fixing the big errors listed here https://validator.w3.org/
Next step is to make sure css and js is added correctly see
https://www.drupal.org/node/756722
Examples in the above link work for CSS as well as JS with minor changes.
Comment #63
mikeytown2 commentedGoing to close this issue; I think fixing the body tags would help with IE rendering speed.