Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
255 stars 46 forks source link

Symfony integrated HttpCache reverse proxy cannot serve cached responses #134

Open Aleksa1996 opened 6 months ago

Aleksa1996 commented 6 months ago

Booting Kernel happens here, before request handling: https://github.com/Baldinof/roadrunner-bundle/blob/ed13b632c5c916d81a217d68dec2c7daf81b2631/src/Runtime/Runner.php#L21

So that booting is preventing this line to trigger HttpCache reverse proxy: https://github.com/symfony/http-kernel/blob/1352be19da94ca65d54d20f977b85cee1b397f35/Kernel.php#L172

My suggestion would be to edit this: https://github.com/Baldinof/roadrunner-bundle/blob/ed13b632c5c916d81a217d68dec2c7daf81b2631/config/services.php#L92

replace:

$services->set(KernelHandler::class)
        ->args([
            service('kernel'),
        ]);

with something like this:

$services->set(KernelHandler::class)
        ->args([
            service('http_cache'),
        ]);

Also we maybe need to check if http_cache is enabled in framework.yaml ?

As im not expert in this, are there any better suggestions how to solve it ? :)

Thanks!