mikeytown2’s picture

First step is to bring the number of bundles from 4 down to 1. Taking hints from #1246816: Create workaround for jquery update ahah form bug when using node clone and a filefield loading jquery.js from googles cdn.

* Implementation of hook_advagg_disable_processor().
function example_advagg_disable_processor() {
  global $conf;
  $arg = arg();

  // On the node/*/clone page
  // Disable the AdvAgg Full Cache
  // Set advagg_bundler_max_js to Zero
  // Set advagg_bundler_max_css to Zero
  if (isset($arg[0]) && isset($arg[1]) && isset($arg[2]) && empty($arg[3]) && $arg[0] == 'node' && is_numeric($arg[1]) && $arg[2] == 'clone') {
    $conf['advagg_use_full_cache'] = FALSE;
    $conf['advagg_bundler_max_js'] = 0;
    $conf['advagg_bundler_max_css'] = 0;

The next step is to change the rendering functions so it outputs inline code instead of link and script src tags. $conf['advagg_css_render_function'] $conf['advagg_js_render_function']

The step after that would be the use of some sort of output buffer to put the CSS code on the the actual HTML DOM elements.

doublejosh’s picture

Step #2 seems to be what emogrifier is all about.

mikeytown2’s picture

The final step (emogrifier) is about putting the styles on the actual div tags. For HTML this isn't necessary. Having the style tags in the header is all that's needed and AdvAgg can do this currently IF you create a render function to read the file contents. It's fairly trivial so I might create the module for fun. Config: A list of pages that get all local JS/CSS files inlined. Warn the user that this is a bad idea most of the time.

mikeytown2’s picture

2.52 KB

committed this patch, might make this a little easier to do.

mikeytown2’s picture

mikeytown2’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Issue tags: +submodule

Switching to the 7.x-2.x branch.
#1171546-105: AdvAgg - D7 Port/Re-write

mikeytown2’s picture

mikeytown2’s picture

Status: Active » Fixed
9.58 KB

This patch has been committed.

If this is a major performance issue, I could use the more exotic hook hook_advagg_modify_js_pre_render_alter & hook_advagg_modify_css_pre_render_alter to accomplish the same thing.

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