Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.0
Description: 

A new $settings['asset_gc_threshold'] has been introduced, defaulting to 45 days. When caches are cleared, asset aggregates older than this threshold will be deleted, newer files will be retained. This replaces the previous behaviour where all asset aggregates would be deleted on each cache clear.

This change means that aggregates will not have to be recreated immediately after a cache clear, but only if the asset versions, or contents of unversioned assets, have changed in the code base, leading to much higher CDN and browser cache hit rates (thanks to more stable Etag and last-modified headers), and a reduction in the number of times the same file has to be regenerated by Drupal.

During development, especially of assets with a specified version, developers may want to set this threshold to 0 so that all files are deleted. Site owners should be able to leave this setting to the default 45 days.

Impacts: 
Site builders, administrators, editors