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.
Log in to your project, and in the debug toolbar, click on the request section. Then, scroll down to the Response header and check the contents:
As you can see, only Cache-Control is sitting here with some default values among the cache headers that we are interested in.
When you don't set any value for Cache-Control, Symfony considers...