Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

drupal_clear_css_cache() and drupal_clear_js_cache() were tightly coupled to the default implementations of the CSS and JS asset collection optimizer services. This made it de facto impossible to swap it out. This was an oversight in #352951: Make JS & CSS Preprocessing Pluggable (also see the change notice for that issue: https://www.drupal.org/node/2034675).

drupal_clear_css_cache() and drupal_clear_js_cache() are now marked as deprecated. \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll() now allows for aggregate deleting. So:

  1. drupal_clear_css_cache()\Drupal::service('asset.css.collection_optimizer')->deleteAll();
  2. drupal_clear_js_cache()\Drupal::service('asset.js.collection_optimizer')->deleteAll();
Impacts: 
Module developers