1

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?

2 Answers 2

1

Symfony decided to deprecate the entire ClassLoader component for Symfony 3.3+.

In this case line below is no longer available

$kernel->loadClassCache(); // deprecated

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

Sign up to request clarification or add additional context in comments.

2 Comments

This statement is completely wrong. "deprecated" does not mean it "is no longer available" nor that it does not work. It work perfectly fine in both 3.3 and 3.4. It means it is not available in 4.0 which is not the case here. Compare 3.2 to 3.4
That's right, in addition HTTP Cache still doesn't work.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.