public function warmupAction()
{
$request = $this->getRequest();
$purge = $request->getParam('purge', false);
$verbose = $request->getParam('verbose', false) || $request->getParam('v', false);
// purge cache for every configuration
if ($purge) {
$this->purgeCache($verbose);
}
$this->output('Collecting all assets...', $verbose);
$collection = $this->assetManager->getResolver()->collect();
$this->output(sprintf('Collected %d assets, warming up...', count($collection)), $verbose);
foreach ($collection as $path) {
$asset = $this->assetManager->getResolver()->resolve($path);
$this->assetManager->getAssetFilterManager()->setFilters($path, $asset);
$this->assetManager->getAssetCacheManager()->setCache($path, $asset)->dump();
}
$this->output(sprintf('Warming up finished...', $verbose));
}