I have recently start work with twig in my project, I have check that twig have create cache folder, and check that twig basically create some php classes for cache,
I want to understand exactly how this mechanism is work, how it beneficial to reduce the page loading time, any one can help me ?
Twig evaluation process looks like:
With Twig templates caching you eliminate step #1, since the transformation results are written to a cache files.
So it is highly recommended to use it on production. Just make sure you clear the template directory cache on deploy or specify another directory as a target. It could be a good idea to include the application version number in the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With