Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | advagg-1943418-2-no-negative-ratios.patch | 793 bytes | mikeytown2 |
#1 | advagg-1943413-1-inline-js-compression.patch | 14.29 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedPutting 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.
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedAlso added in a patch to prevent negative ratios from being used (if compression made things worse, don't use it).
Comment #3
markhalliwellSweet, 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.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedNo inline js gets put into a file. It does js compression inline, no new files created.
Comment #5
markhalliwellSorry, I completely misread your comment. It's been a long week.