There are a few nice things that IE CSS Optimizer and other modules do, and I wonder if advagg does the same. I'd like to ask before I try, cause I'm lazy..

IE 31 stylesheet limit
Both IE CSS Optimizer and IE Unlimited CSS Loader can work around the 31 stylesheet limit in IE.
The module page of advagg does mention those modules, but it does not explicitly say that advagg will do the same.
(in D7 this problem is fixed in core)

Exclude some js/css from aggregation
That's a useful thing in IE CSS Optimizer: You can exclude a specific module or theme from CSS aggregation for easier development and troubleshooting. This module could go one step further and do the same for js files.
The module page does not talk about this, so I don't know if anything like this is supported or planned.
See also #694840: This is great! Possible for JS files as well? on IE CSS Optimizer.

We could go further than this:
- Disable aggregation for specific users, or in a session variable or GET param.
- Disable aggregation for more than one module or theme.
- Disable aggregation for individual files.
- A drush command to quickly change this configuration.

Minification
The Javascript Aggregator does (for D6) provide minification, in addition to the aggregation. As I understand, advagg does the same. Still, it would be useful to explicitly say on the module page that you no longer need Javascript Aggregator, if you have advagg - if that is the case.

------

I am especially interested in "exclude from js aggregation" thing. I need to know if this deserves a new module, or if it can be done inside advagg. Or maybe it could use advagg as an API ?
Btw, my personal use cases are all on D6 atm.

Please turn into a feature request, if applies.

Comments

mikeytown2’s picture

IE 31 stylesheet limit:
AdvAgg works around the 31 stylesheet limit in IE.

Exclude some js/css from aggregation:
This is not directly implemented, but it can easily be done with some hooks. In practice what I do is add ?advagg=0 to the end of the URL so that advagg is turned off for that request; you need the "bypass advanced aggregation" permission in order for this to work.

Minification:
If you install AdvAgg, on the status report page admin/reports/status it will list the various modules that no longer need to be enabled if they are enabled; Javascript Aggregator is one of them.

Exclude from js aggregation:
If you wish to target a specific file you can use hook_advagg_js_pre_alter/hook_advagg_css_pre_alter to accomplish this. You can use advagg_js_cdn_advagg_js_pre_alter() as an example; although it does a lot more than what your looking for. Below is code more in line with what your looking for.


/**
 * Implement hook_advagg_js_pre_alter.
 */
function custom_advagg_js_pre_alter(&$javascript, $preprocess_js, $public_downloads, $scope) {
  foreach ($javascript as $type => &$data) {
    // Skip inline and setting js.
    if (!$data || $type == 'setting' || $type == 'inline') {
      continue;
    }

    // Search for the file(s).
    foreach ($data as $path => &$info) {
      // remove all mine.js files from being aggregated.
      if (advagg_string_ends_with($path, 'mine.js')) {
        // $data & $info passed by reference, changing the value here will
        // change it in the $javascript array.
        $info['preprocess'] = FALSE;
        // $javascript[$type][$path] = $info; // This line is not needed.
      }
    }
  }
}
donquixote’s picture

Cool stuff.
I should definitely give this a try.
Are you going to add this info to the module page?

If you install AdvAgg, on the status report page admin/reports/status it will list the various modules that no longer need to be enabled if they are enabled; Javascript Aggregator is one of them.

Cool!

donquixote’s picture

Another question..
I remember you started some requests on the unlimited_css issue queue.
I rather wanted to keep the module simple, and was not really convinced of the need for any of these.

I am curious, now that you have your playground, has any of this been implemented in advagg?
#652690: Only process CSS if the browser is IE
#855038: Make the "magic number 22" configurable.

mikeytown2’s picture

#652690: Only process CSS if the browser is IE is implemented, only if you are logged in; variable is advagg_css_logged_in_ie_detect
#855038: Make the "magic number 22" configurable. is implemented; variable is advagg_css_count_threshold
You can view this code here advagg_unlimited_css_builder()

Both variables are hidden, there is no gui for them so you need to set these via $conf[''] in settings.php or via drush.

donquixote’s picture

Thanks.
and as we are at it, the IE CSS Optimizer works differently than IE Unlimited CSS Loader, in that it will use a mix of @import and <link> if it hits the 31 stylesheet limit. I have no idea if this is better or worse, but would be interesting to know.

Anyway, great to see this new thing on the table. I should update the module page of Unlimited CSS :)

mikeytown2’s picture

Status: Active » Fixed

I do not use a mix any more. I used to until this issue #1193350: Serving unstyled pages while bundles are initially generating

Anyway marking this as fixed as I believe I've answered all your questions. If not, reopen.

Status: Fixed » Closed (fixed)

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

devtherock’s picture

I had a issue where IE was ignoring css after 288kb in size. This is actually bug of IE where it denies to accept css if a single file exceed 288kb (after gzip we may have this size of css in big and complex site). We Used this module fix the problem.

Thanks
Dev

mikeytown2’s picture

I learn something new every day. Thanks for letting me know!
http://joshua.perina.com/africa/gambia/fajara/post/internet-explorer-css...