Edge Side Includes in Laravel

829 Views Asked by At

I've been looking at the use of ESI tags in Symfony through Varnish and I'm wondering if the same thing can be done in Laravel, and if so, how?

A Senior Developer at work wants us to switch from Laravel to Symfony and is currently using ESI tags as a reason to make the switch, leading me to believe it's exclusive to Symfony, but that doesn't make sense from what I've read of it.

2

There are 2 best solutions below

1
Lucky Soni On

Laravel uses Blade for templating.

You can include a file like @include('shared.errors')

Please refer to Laravel's documentation on usage of Blade here

0
Alessandro Benoit On

I know it's an old question but as it comes first when looking for Laravel ESI on Google, it should be known that you can handle ESI in Laravel with Laravel HttpCache by Barry vd. Heuvel.