Skip to content

render_esi breaks web dev toolbar #62451

@mmarton

Description

@mmarton

Symfony version(s) affected

7.4.0-rc2

Description

Hi!

testing the new 7.4, and the dev toolbar failed to load and no data is collected if my template has a render_esi(...) call in them.

Image

The token is there in the response:

HTTP/1.1 200 OK
Date: Thu, 20 Nov 2025 11:25:52 GMT
Server: Apache/2.4.65 (Debian)
X-Powered-By: PHP/8.4.14
Cache-Control: must-revalidate, no-cache, private
X-Debug-Token: 909bce
X-Debug-Token-Link: http://ticat.loc/_profiler/909bce

But not data in the profiler
Image

How to reproduce

<?php

declare(strict_types=1);

namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\Routing\Attribute\Route;
use Twig\Environment;

#[AsController]
final readonly class TestController
{
    #[Route(path: '/test')]
    public function test(Environment $twig): Response
    {
        return new Response($twig->render('test.html.twig'));
    }

    public function esi(): Response
    {
        return new Response('Hello ESI!');
    }
}
<!doctype html>
<html>
<head></head>
<body>
Hello template!

{{ render_esi(controller('App\\Controller\\TestController::esi')) }}
</body>
</html>

!!! IMPORTANT !!!:
!You need to set framework.http_cache to true, for reproducing the issue!

framework:
    secret: '%env(APP_SECRET)%'
    http_cache: true
    session: true
    esi: true
    fragments: true

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions