Question on caching?

it is necessary to cache the page indefinitely
page generates for the 1st user who opened it and displayed to all subsequent users until someone will not call php reset.php ( manually or via crown )

how it can be implemented?
where to maintain state?
June 14th 19 at 20:09
1 answer
June 14th 19 at 20:11

Clear the symfony http cache is not out of the box, you can use the command:
use Symfony\Component\Console\Command\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\Kernel;

class HttpCacheClearCommand extends Command
 * @var string
 private $cacheDir;

 public function __construct($name, $cacheDir)

 $this->cacheDir = $cacheDir;

 protected function configure()
 ->setDescription('Clear http cache')

 protected function execute(InputInterface $input, OutputInterface $output)
 $exec = sprintf('rm-rf %s/*', $this->cacheDir);

cache_dir: '%kernel.cache_dir%/http_cache'

Or use component Cache and clean with
bin/console cache:pool:clear

Find more questions by tags CachingPHPSymfony