As seen in the previous section, using HTTP compression is a step in the right direction. But we should really look at how to speed up Symfony before the final content is compressed and delivered. The solution to this is the use of caching. To limit the amount of processing required, Symfony offers a caching framework. Basically, it stores chunks of your code as native PHP in a temporary file. But it is not just the amount of processing that is saved through the framework. Result sets fetched from the database too can be cached, which means less connections to the database server and less processing by the database server too. By default, these temporary cache files are stored in the cache/
folder, which we touched upon while creating the back office.
Essentially, Symfony will first check the cache
directory before processing the configuration. If caching is enabled, there is no need to execute the action that ultimately speeds up the response and/or the layout. However, this will...