CSS/JS Aggregation Retention
This module restores a time-based garbage collection for CSS and JavaScript aggregate files. It prevents the complete deletion of aggregate directories during cache rebuilds, reinstating the previous behavior of only removing stale files.
This module restores time-based garbage collection for CSS and JavaScript aggregates, preventing the complete deletion of aggregate directories during cache rebuilds that was introduced in 10.1.
Background
Drupal 10.1 introduced significant performance improvements to CSS/JS aggregation by implementing lazy generation of aggregate files. However, these changes also modified cache clearing behavior to delete entire /sites/*/files/{css,js} directories during every cache rebuild (drush cr).
While this approach works well for dynamic sites where aggregates can be regenerated on-demand, it creates critical issues for static generators.
This module reinstates the pre-10.1 behavior by preventing wholesale deletion of CSS/JS directories during cache clears and implementing time-based cleanup that only removes genuinely stale files.
Relates issues:
- #3301573: Remove the aggregate stale file threshold and state entry
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha3 | Pre-release | 10–11 | Apr 25, 2026 | ||
| 1.0.0-alpha2 | Pre-release | 10–11 | Fix module installation error and improve service dependency injection. | Feb 7, 2026 | |
| 1.0.0-alpha1 | Pre-release | 10–11 | Jun 12, 2025 | ||
| 1.x-dev | Dev | 10–11 | Jun 12, 2025 |