function drupal_clear_js_cache

Deletes old cached JavaScript files and variables.

2 calls to drupal_clear_js_cache()
drupal_flush_all_caches in drupal/core/includes/common.inc
Flushes all persistent caches, resets all variables, and rebuilds all data structures.
PerformanceForm::submitForm in drupal/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php
Implements \Drupal\Core\Form\FormInterface::submitForm().

File

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

Code

function drupal_clear_js_cache() {
  Drupal::state()
    ->delete('system.javascript_parsed');
  Drupal::state()
    ->delete('system.js_cache_files');
  file_scan_directory('public://js', '/.*/', array(
    'callback' => 'drupal_delete_file_if_stale',
  ));
}