0

I have a drupal 7 site. I use the Advanced CSS/JS Aggregation module

In the past I asked this question, and tried to improve performance and "Eliminate render-blocking JavaScript and CSS in above-the-fold content" as Google Page speed test suggested.

After I got answers to the question I changed the module configuration, and set the Target Number Of CSS & JS Bundles Per Page to be 4.

For some reason, now, when I am running speedtest, I see that I have "9 blocking script resources and 5 blocking CSS resources" instead of 4 clocking for CSS and 4 blocking for script.

Why is that happening?
How can I fix it, and make the advagg configuration work?

1

The bundler works per region, so set it to 2 for JS as you have footer JS and header JS; 2 header + 2 footer + 2 external scripts will give you 6 for desktop and 3 for mobile, as Page Speed Insights seems to only count header JS for mobile. Moving all the JS to the footer might help eliminate all render blocking JS with mobile according to Page Speed Insights Mobile; it will also give you a better score for the Page Speed Insights desktop as more JavaScript files can be combined.

You can disable the bundler as that will give you a better score, but you will have to download a new full sized CSS/JS aggregate if any of the CSS/JS changes per page on your site; so you won't be able to fully take advantage of the browser cache and real world performance will not be as optimal as it could be if you do disable the bundler. It's about tradeoffs.

http://www.webpagetest.org/result/140619_5M_134C/ Shows a decent report as well.

  • Thanks for your answer. Just to be sure that I understand - Without the bundler I will have only one file (block) to download, and not few, and that will give me a better score. But, if one of the pages changes, I will need to download this file all over again. But, if I have few files (blocking) - I will need to download only the one that has changed? So 4 blocking for css and 4 for JS is recommend? I moved the all the java script to the bottom (under modification) - that's OK? – EB84 Jun 20 '14 at 9:22
  • If your on a different page with a different set of js or CSS files with no bundler then you have a one large file to download again. By using the bundler that will reduce the total bytes transferred when there is a CSS or js change. moving to the footer is usually safe, be sure to check the 'Put a wrapper around inline JS if it was added in the content section incorrectly' box if moving all js to the footer. – mikeytown2 Jun 20 '14 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.