Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Drupal 8 Advanced Aggregation: Better PageSpeed Without Guesswork

By Greg Nowak. Updated 2 August 2026.

Advanced CSS/JS Aggregation, usually called AdvAgg, can still help when you inherit a slow Drupal 8 site. But it is a diagnostic and delivery tool—not a cure for an oversized theme, indiscriminate module assets, or years of marketing scripts.

The business goal is also bigger than earning a green PageSpeed score. A useful performance project makes important pages faster for real visitors, protects forms and other conversion paths, and tells the team whether further tuning is sensible or merely postponing an overdue rebuild.

First decide whether you are tuning or upgrading

Drupal 8 reached end of life on 17 November 2021 and no longer receives core security fixes. AdvAgg’s project page now says the module is obsolete on Drupal 10.1 and newer, recommends uninstalling it on modern Drupal versions, and lists no supported stable release.

That creates a clear boundary. Use AdvAgg for controlled triage on an existing Drupal 8 installation when immediate performance problems are hurting the business. Do not introduce it as the foundation of a new performance strategy. Any substantial investment should include a route to a supported Drupal release; Drupal 10 itself is scheduled to reach end of life on 9 December 2026.

Situation Recommended decision Immediate action
Drupal 8 must remain live temporarily Stabilise and measure Use AdvAgg cautiously while creating an upgrade backlog.
Drupal 10.1 or newer Use Drupal core Remove AdvAgg through a tested deployment and enable core aggregation.
Most transferred code is unused Reduce assets first Attach libraries only to the templates or components that need them.
Forms or navigation break after optimisation Roll back the latest change Fix dependencies before attempting another delivery optimisation.
Platform maintenance is already fragile Limit tactical work Spend enough to control immediate risk, then prioritise the upgrade.
A practical decision matrix for inherited Drupal performance work.

Measure pages that matter to the business

Do not optimise from one homepage test. Select a small, representative set: the homepage, a major service page, a paid-campaign landing page, a content-heavy template, and the page containing the most important form or transaction.

Run each URL through PageSpeed Insights on mobile and desktop. Record the result before changing anything. PageSpeed Insights combines controlled Lighthouse lab data with Chrome real-user field data when sufficient data exists. Lab data helps diagnose a particular run; field data describes visitor experiences collected over a trailing 28-day period. A higher lab score is encouraging, but it does not prove that real-user LCP, INP, or CLS has improved.

Keep a compact test log containing the URL, device profile, change made, caches cleared, before-and-after result, and any functional regression. This is especially valuable when an agency, hosting provider, and internal team share responsibility.

Use AdvAgg to reveal what Drupal is shipping

For an authorised account with the appropriate permission, append ?advagg=0 to a URL to disable file aggregation for that request. Use ?advagg=-1 when you need to bypass AdvAgg and its submodules completely. The unaggregated file names make it easier to identify the theme or module responsible for an asset.

On a local or staging environment, preprocessing and AdvAgg can also be disabled through configuration overrides:

$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
$config['advagg.settings']['enabled'] = FALSE;

Do not make this a production default. Reload the page with Chrome DevTools Coverage recording, then exercise menus, accordions, forms, consent controls, and other relevant interactions. Coverage reports used and unused CSS and JavaScript bytes. A file that remains largely unused is a lead for investigation—not automatic permission to delete it, because code may run only after an interaction or on another template.

Reduce asset waste before tuning delivery

Aggregation combines files; it does not make unnecessary code necessary. Drupal’s library system supports attaching assets globally, to a specific Twig template, or conditionally through a render element or preprocess function. A slider library should load with the slider component, for example, rather than every page in the theme:

{{ attach_library('mytheme/slider') }}

Audit third-party code in the same way. Chat tools, maps, video embeds, analytics, personalisation, consent platforms, and A/B testing can compete for bandwidth and main-thread time. Ask who owns each script, which pages require it, and what decision or conversion it supports. Remove abandoned tools; scope or delay the rest where their behaviour allows it.

Change one delivery setting at a time

If AdvAgg is already installed, begin with reversible changes under admin/config/development/performance/advagg. Test minification before experimenting with script relocation or asynchronous CSS. Clear Drupal caches after each change and repeat the same page set.

Modifier options such as moving JavaScript to the footer or adding defer can help, but they can also expose undeclared dependencies or alter execution order. Regression-test navigation, search, forms, authentication, checkout, consent, analytics events, and logged-in administration. Precompressed gzip or Brotli assets may reduce transfer size when the web server is configured to serve them, but compression still cannot compensate for shipping irrelevant libraries.

Set a stop rule

Agree in advance when tactical optimisation ends. Warning signs include incompatible PHP requirements, unsupported modules, recurring cache failures, fragile deployment steps, and performance changes that consume more regression-testing time than they save.

The useful deliverable is not a perfect screenshot. It is a prioritised backlog separating quick asset fixes, hosting or cache work, third-party decisions, and upgrade dependencies. If you need an independent view of that trade-off, Greg can review the Drupal stack and turn the findings into a practical delivery plan.

Related on GrN.dk

  • Critical CSS for Faster Pages: When It Helps and When It Does Not
  • Why Your Website’s Third-Party Stack Needs a Real Owner
  • AI Crawler Control for Business Websites: Protect Content Without Vanishing from Search

Need help with this kind of work?

Discuss your Drupal performance plan Get in touch with Greg.

Sources

  • Advanced CSS/JS Aggregation
  • Drupal core release schedule
  • About PageSpeed Insights
  • Coverage: Find unused JavaScript and CSS
  • Adding assets to a Drupal theme via libraries.yml
Last modified
2026-08-02

Tags

  • Drupal
  • Drupal 8
  • PageSpeed
  • Web Performance
  • Technical SEO
  • Log in to post comments

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: AI crawler policy now has verbs: separate search, RAG, and training
AI crawler policy now has verbs: separate search, RAG, and training
2026-08-02

AI crawler rules now need separate decisions for search, RAG, and training, backed by practical testing across robots.txt, CDNs, WAFs, and CMS controls.

Illustrated infographic summarizing: WordPress Supports Old PHP; Your Production Server Shouldn’t
WordPress Supports Old PHP; Your Production Server Shouldn’t
2026-08-01

WordPress still runs on legacy PHP, but compatibility is not a security policy. Build and test your upgrade path before PHP 8.2 support ends.

Illustrated infographic summarizing: The AI-built tool your team relies on needs an owner
The AI-built tool your team relies on needs an owner
2026-07-31

AI-built internal tools can become business-critical before anyone owns them. Here is how to secure, review, monitor, and retire them without blocking useful work.

Illustrated infographic summarizing: Your AI model has an expiry date: build the migration lane now
Your AI model has an expiry date: build the migration lane now
2026-07-30

AI models retire on a schedule. Learn how to map dependencies, test replacements, release safely and preserve a working rollback route.

Illustrated infographic summarizing: Copilot Has Repo-Level Metrics Now. What Should Teams Measure?
Copilot Has Repo-Level Metrics Now. What Should Teams Measure?
2026-07-29

GitHub’s repo-level Copilot metrics show where AI is active, but not whether it adds value. This scorecard connects usage with delivery, quality, and cost.

Illustrated infographic summarizing: Not Every AI Job Needs an Instant Answer: Batch the Backlog
Not Every AI Job Needs an Instant Answer: Batch the Backlog
2026-07-28

Move delay-tolerant AI work into dependable batch queues to cut processing costs without compromising quality, data controls, or urgent workflows.

Illustrated infographic summarizing: A stray Set-Cookie can waste your CDN: audit the cache at the edge
A stray Set-Cookie can waste your CDN: audit the cache at the edge
2026-07-27

Cloudflare Cache Response Rules can recover wasted CDN capacity, but first you need a route-level audit of public, personal and authenticated responses.

Illustrated infographic summarizing: Shorter TLS certificates expose every renewal you never automated
Shorter TLS certificates expose every renewal you never automated
2026-07-26

Shorter TLS lifetimes leave less room for manual handoffs and faulty deploy hooks. Build a renewal path that protects service availability.

Illustrated infographic summarizing: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.