I know that the inline JS settings added to a site can differ from page to page, however these settings can also add to the overall page size required for initial HTTP request. Instead of this long inline JS, perhaps it could parsed into a file and served this way? Just an idea.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Fixed
FileSize
14.29 KB

Putting the inline js into a file is somewhat interesting; but if one is doing that, do it manually. As for putting the js settings into a file, it is technically possible and in fact a lot easier to do with the new hook advagg_modify_js_pre_render_alter() but at this point in time would require a lot of work in order to do it right (404 protection, etc).

So for now this patch will allow one to compress inline js, js settings included. It has been committed.

mikeytown2’s picture

Also added in a patch to prevent negative ratios from being used (if compression made things worse, don't use it).

markhalliwell’s picture

Sweet, does this also at least aggregate inline JS into a separate file since Drupal settings can be different from page to page (admin wise). Just curious.

mikeytown2’s picture

does this also at least aggregate inline JS into a separate file

No inline js gets put into a file. It does js compression inline, no new files created.

markhalliwell’s picture

Sorry, I completely misread your comment. It's been a long week.

Status: Fixed » Closed (fixed)

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