You are here

function drupal_clear_css_cache in Drupal 8

Same name and namespace in other branches
  1. 5 includes/common.inc \drupal_clear_css_cache()
  2. 6 includes/common.inc \drupal_clear_css_cache()
  3. 7 includes/common.inc \drupal_clear_css_cache()

Deletes old cached CSS files.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll().

See also

https://www.drupal.org/node/2317841

File

core/includes/common.inc, line 443
Common functions that many Drupal modules will need to reference.

Code

function drupal_clear_css_cache() {
  \Drupal::service('asset.css.collection_optimizer')
    ->deleteAll();
}