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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.