I've tested code form Symfony Docs in Symfony 3.2 and it was everything good, but cache doesn't work in 3.4.8.
Of courese I want to use Symfony Reverse Proxy.
My app_dev.php
$kernel = new AppKernel('dev', true);
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
$kernel = new AppCache($kernel);
My action look's like this:
public function indexAction(Request $request)
{
// [...]
$response = $this->render('base.html.twig');
$response->setSharedMaxAge(3600);
return $response;
}
Am I missing something, that isn't nessesery in Symfony 3.2?
I found it's imposible, by some Symfony 3.4 bug. I used Symfony Cache Component instead https://symfony.com/doc/current/components/cache.html.
Symfony decided to deprecate the entire ClassLoader component for Symfony 3.3+.
In this case line below is no longer available
In this case you should use class loader provided by Composer. If you are not using PHP 7.0 yet, you should stay with Symfony 3.2.
Useful links
New in Symfony 3.3: Deprecated the ClassLoader component
Autoloader Optimization