Make Modifications Before Being Outputted

I want to make certain elements/sections of my page to be modified post-cache. In Kirby 2 I can do that by replacing the response core component However in Kirby 3 it seems like it’s been removed from the list: Any insights on how I can achieve this?

Help please :pray:

Hm, I don’t know, but if you use a route:after hook, you can intercept any output

    'hooks' => [
        'route:after' => function ($route, $path, $method, $result) {
           return 'hello';

This is a pretty silly example as it will return hello for every single route, including the Panel. But maybe that is too late in the process for your purposes.

Let’s cry for help :mega::@lukasbestle, @distantnative

Yes, that’s the best way to catch and modify every response in Kirby 3.

Thanks for confirming, @lukasbestle.