CSS Bundle Similar Size Files

Created on 26 February 2023, almost 2 years ago
Updated 27 February 2023, almost 2 years ago

Problem/Motivation

We have a site configured to generate two CSS bundled and it generated 2 x 20KB CSS files which worked really well from getting a very good 'initial server response'.

Few weeks ago, we changed the server and now for some reason it's still generating two bundles but first one is just 4Kb while other is 36kb. I have tried for days to fiddle with settings to get two equal size files generated.

Is there anything I can do to get two similar size bundles like before? I don't have the exact settings from last server.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Fixed

Version

2.0

Component

Bundler

Created by

πŸ‡¦πŸ‡ΊAustralia standingtall

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @standingtall
  • πŸ‡¦πŸ‡ΊAustralia standingtall

    I set up a replica server. Same configuration, both generate different size CSS bundles.

    Removed Advagg, re-installed and still no luck.

    It appears when you turn it on first time, it picks up a logic and sticks with it.

    I am this close to ditching Drupal after 12 years due to how critical Advagg is and how unreliable it is.

  • πŸ‡¦πŸ‡ΊAustralia standingtall

    Update:

    Replica site shows 156 bundler groupings. Production sites show 86 bundler groupings. They have exactly same codebase.

  • πŸ‡¦πŸ‡ΊAustralia standingtall

    This seems like an abandoned project. I would highly advise against using Advagg on production sites as it's extremely unreliable out of box and by the sheer amount of unanswered support queries, it seems it has been abandoned.

    Anyone with same issue, your only option seems like using Drupal Add Js to manually balance the aggregates by trial and error.

    // loading font awesome separately to get it into aggregates

    drupal_add_css(drupal_get_path('theme', 'mytheme') . '/font-awesome/css/font-awesome.min.css');
    
  • πŸ‡ΊπŸ‡ΈUnited States mikeytown2

    Day job is C# for me these days. Anyway advagg bundler works based off the pages hit; crawl your test environment and it'll mimic production. Css/js can be added to any page in drupal in various ways. There's no way to know how the assets will be added in what order. That's a limit of D7. It has to be added and then advagg can learn and react to it.

    There's a hook in the bundler that'll allow you to modify what you need. The current way is the bundler tries to have equal number of files in each bundle. Due to minification and gzip it's hard to predict file size after the fact

  • Status changed to Fixed almost 2 years ago
  • πŸ‡¦πŸ‡ΊAustralia standingtall

    Thanks.

    After few hours and trial and error, disabling and enabling the base Bootstrap theme fixed it in an instant. Not sure how it was affecting aggregate generation but all good now.

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

Production build 0.71.5 2024