public function ToolbarController::flushLibraries in Helper 8
Flush the libraries (and CSS/JS) cache.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse Reloads the page.
1 string reference to 'ToolbarController::flushLibraries'
File
- src/
Controller/ ToolbarController.php, line 86
Class
- ToolbarController
- Toolbar controller.
Namespace
Drupal\helper\ControllerCode
public function flushLibraries() {
Cache::invalidateTags([
'library_info',
]);
\Drupal::service('asset.css.collection_optimizer')
->deleteAll();
\Drupal::service('asset.js.collection_optimizer')
->deleteAll();
_drupal_flush_css_js();
$this
->messenger()
->addMessage($this
->t('Libraries cache cleared.'));
return new RedirectResponse($this
->reloadPage());
}