Using Advagg, my site still requires 12 css and 9 JS requests.
I was expecting one of each.
That does not significantly change if I enable / disable or change the settings of bundler.

Clarification / help would be appreciated.

Comments

jvieille created an issue. See original summary.

jvieille’s picture

Title: What "aggegation" means exactly? » What "aggregation" means exactly?
mikeytown2’s picture

What does the html header look like? Is use core groups off? View the source of this page to see advagg in action.

jvieille’s picture

For js/css optimization is off.
In the meantime, the number of css end js dropped to 6 and 6. Maybe this comes from the change in bundler from 4 to 1, not taken immediately (not sure how Boost interact with Advagg).

For css, 5 are from Advagg, one file keeps separate (grid16-fluid.css?5).

For js, one single Advagg aggregate as expected now, but some js files are not in. They appeared in the following order
- labjs.min.js
- jquery.min.js,
- swfobject.js
- js_7087801a335e59061700c869dd7c8b38_4.js
- views_charts.js?5
- analytics.js?5

Thanks for your help

mikeytown2’s picture

This with Drupal 7? If yes disable labjs and try again.

jvieille’s picture

it is Drupal 6

mikeytown2’s picture

Version: 7.x-2.18 » 6.x-1.x-dev
mikeytown2’s picture

I'd still try disabling labjs. What does the status report say?

jvieille’s picture

The status report was happy.
Does boost "re-cache" adavagg aggregates, or do they work independently?

I disabled Labjs, and got just one js file less - Labjs - not hurting much performances apparently.

jquery.min.js and swfobject.js are from ajax.googleapis.com

mikeytown2’s picture

Does boost "re-cache" adavagg aggregates, or do they work independently?
Doesn't matter. All that matters is what the HTML output is.

jquery.min.js and swfobject.js are from ajax.googleapis.com
It's impossible to aggregate an external source and keep it external.

So the issue are these 2 files
views_charts.js
analytics.js

hook_advagg_js_pre_alter() is VERY similar to hook_js_alter() in D7. You'll want to change the preprocess key to TRUE for these 2 files.

If you look at views_charts_init() you'll see that the last parameter to drupal_add_js() is false (preprocess); guessing this is the same for analytics.js unless that is also external.

jvieille’s picture

analystics.js is external.
I changed views_charts_init(), JS is OK now.

And what about CSS? still 6 sheets, among them 5 aggregates

grid16-fluid.css not in aggregate, but this is intentional apparently
https://www.drupal.org/node/713596#comment-2596924

What should I check?

Thanks again.

mikeytown2’s picture

Look at #3. What is exactly in the header? Knowing what the actual HTML looks like will get you quicker answers. Off the top of my head the reason for CSS being split up like that is different media types and browser conditionals. Both of these can easily be "fixed" in the 2.x branch of advagg, unfortunately there are no easy options in the 1.x branch.

jvieille’s picture

Actually, there are 2 advagg aggregates, 3 ctools seemingly aggregates and one theme css

/files/advagg_css/css_81242f3eebeb2a6682db1eec3494da5e_2.css
/files/advagg_css/css_356dcdd9e432e44311caba61dd7353bd_2.css

/files/ctools/css/d8cb3486c453b26bfaebd5cc8164a287.css?i
/files/ctools/css/4990fef605f86316c36b567f927fed18.css?
/files/ctools/css/601f5d2e4a951720e6a140aa2f9e445b.css?i

/themes/fusion/fusion_core/css/grid16-fluid.css?i

1) what can prevent the fusion css to be aggregated?
2) what happens with ctools? is that notmal, anything to loog at?
3) below the headers of the 2 advagg aggegates

https://www.see.asso.fr/sites/www.see.asso.fr/files/advagg_css/css_81242f3eebeb2a6682db1eec3494da5e_2.css

GET /sites/www.see.asso.fr/files/advagg_css/css_81242f3eebeb2a6682db1eec3494da5e_2.css HTTP/1.1
Host: www.see.asso.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/css,*/*;q=0.1
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://www.see.asso.fr/
Cookie: _ga=GA1.3.1507787071.1454323094; SESS49d6a4b14bb30beb24db03b809981c0d=d0jqah5e571esjo13a2fb6c8b6; _gat=1
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Date: Fri, 29 Apr 2016 14:53:32 GMT
Server: Apache/2.2.22
Last-Modified: Fri, 29 Apr 2016 14:12:11 GMT
Etag: "fe0066-15-531a03aa44414"
Accept-Ranges: bytes
Cache-Control: max-age=1209600
Expires: Fri, 13 May 2016 14:53:32 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 41
Keep-Alive: timeout=30
Connection: Keep-Alive
Content-Type: text/css
https://www.see.asso.fr/sites/www.see.asso.fr/files/advagg_css/css_356dcdd9e432e44311caba61dd7353bd_2.css

GET /sites/www.see.asso.fr/files/advagg_css/css_356dcdd9e432e44311caba61dd7353bd_2.css HTTP/1.1
Host: www.see.asso.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/css,*/*;q=0.1
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://www.see.asso.fr/
Cookie: _ga=GA1.3.1507787071.1454323094; SESS49d6a4b14bb30beb24db03b809981c0d=d0jqah5e571esjo13a2fb6c8b6; _gat=1
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Date: Fri, 29 Apr 2016 14:53:32 GMT
Server: Apache/2.2.22
Last-Modified: Fri, 29 Apr 2016 14:12:11 GMT
Etag: "fe0068-4ed83-531a03aa44414"
Accept-Ranges: bytes
Cache-Control: max-age=1209600
Expires: Fri, 13 May 2016 14:53:32 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=30
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/css

Thank you very much for your help

mikeytown2’s picture

Sorry I wasn't 100% clear. By header I mean the HTML <head> like this

 <link type="text/css" rel="stylesheet" href="https://www.drupal.org/files/advagg_css/css__lMXgyfmaj0CgmpEZiB-orDr1puz5FkbkE_tHPK8Cgvc__i-lqd1we-2D04w0cVKvitB9Q3rc74TDA8h4mht1da5I__lN6fPa32KCPrfa2DFR_PrioIXIdhNdWLxQDcTXnjQaA.css" media="all" />
<link type="text/css" rel="stylesheet" href="https://www.drupal.org/files/advagg_css/css__QPp1snPjYt_xYr0c_V0IORcEElkIUBBBrvOB4ZE0Gnw__ubdAt11626NII_bJhuNfVKP9BEn1SCFuky9jBSKfs-w__lN6fPa32KCPrfa2DFR_PrioIXIdhNdWLxQDcTXnjQaA.css" media="all" />
  </head>
jvieille’s picture

Got it!

This is ly mostself-explaning for one part: browser conditional - though it is not obvious why the [if gte IE 8] current condition gives 2 CSS.
What about crools?

With FF (same with ie11)

head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>SEE | Société de l'électricité, de l'électronique et des technologies de l'information et de la communication</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="https://www.see.asso.fr/sites/www.see.asso.fr/files/aim_favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="https://www.see.asso.fr/sites/www.see.asso.fr/files/aim_favicon.ico" type="image/x-icon" />
  <link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/ctools/css/d8cb3486c453b26bfaebd5cc8164a287.css?i" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/ctools/css/601f5d2e4a951720e6a140aa2f9e445b.css?i" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/ctools/css/4990fef605f86316c36b567f927fed18.css?i" />

<!--[if gte IE 8]><!-->
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/advagg_css/css_81242f3eebeb2a6682db1eec3494da5e_2.css" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/advagg_css/css_356dcdd9e432e44311caba61dd7353bd_2.css" />
<!--<![endif]-->
<!--[if lt IE 8]>
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/files/advagg_css/css_3984818e3c25b8503a730c6c981d5f82_2.css" />
<![endif]-->
  <link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/themes/fusion/fusion_core/css/grid16-fluid.css?i"/>
  <!--[if IE 8]>
  <link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/themes/fusion/fusion_core/css/ie8-fixes.css?i" />
  <![endif]-->
  <!--[if IE 7]>
  <link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/themes/fusion/fusion_core/css/ie7-fixes.css?i" />
  <![endif]-->
  <!--[if lte IE 6]>
  <link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/themes/fusion/fusion_core/css/ie6-fixes.css?i"/>
<link type="text/css" rel="stylesheet" media="all" href="/sites/www.see.asso.fr/themes/aim/css/ie6-fixes.css?i"/>
  <![endif]-->
    <script type="text/javascript" src="/sites/www.see.asso.fr/files/advagg_js/js_80478e8415b19f24d5a00a23cac78d32_0.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings...
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--

(function(i,s,o,g,r,a,m){...

//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--

(function(i,s,o,g,r,a,m)...
//--><!]]>
</script>
</head>

Thanks!

mikeytown2’s picture

ctools is it's own beast when it comes to css. Similar to what you did with js, you'll need to make sure preprocess is true. hook_advagg_css_pre_alter() is very similar to hook_css_alter(). If the ctools CSS in not inside the css array then you will have to change how ctools works due to the way it add in its own css files ctools_css_add_css(); there isn't a patch that I'm aware of for this unfortunately. Not using a private filesystem is a solution, not sure if it would be possible for you though.

In terms of browser conditionals there's not a lot you can do, luckily not all the css files will be downloaded, only the ones that match the conditional statement so it's not as bad as it seems. You can verify how many css files actually get downloaded by using the net panel in your browser or using a tool like http://www.webpagetest.org/result/160503_4W_29T0/; in this case 6 css files get downloaded, 3 ctools, 2 advagg, 1 fusion theme. So in this case you should be able to get it down to 3 ctools and 1 advagg.

mikeytown2’s picture

Have I answered this question? If yes please change the status of this issue to fixed.

jvieille’s picture

Yes, thanks a lot for your kind help

jvieille’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.