Blazing fast Symfony with Lazy Twig Extensions

Photo by Cris Ovalle on Unsplash

Ever wondered why your Symfony app is so slow? One of the factors is going to be the initialization time of the Twig templating system.

Before your index.html.twig file is rendered, lots of things happen under the hood. Twig won’t render any template until every extension has been instantiated and loaded. As a result, Symfony goes through every service tagged with the…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store