Using the Symfony reverse proxy cache

There is no complicated or lengthy procedure required to activate Symfony's gateway cache. Just open the front controller and uncomment the following lines:

// web/app.php
<?php
//...
require_once __DIR__.'/../app/AppKernel.php';
//un comment this line
require_once __DIR__.'/../app/AppCache.php';  
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
// and this line
$kernel = new AppCache($kernel);            
// ...
?>

Now, the kernel is wrapped around the Application Cache layer, which means that any request coming from the client will pass through this layer first.

Set expiration for dashboard page

Log in to your project, and in the debug toolbar, click on the request section. Then, scroll down to the Response ...

Get Mastering Symfony now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.