I just remembered a change during the latest K3 betas. Bastian posted on Slack:
In order to fix this once and for all I’ve come up with a way to configure the response in your controllers or templates and cache that configuration with the page. This new implementation has a lot of nice side effects.
Here’s how it looks like in a controller for example if you want to change the content type, the response code and set some headers.
$kirby ->response() ->code(202) ->type('rss') ->header('x-foo', 'bar');
My example doesn’t make that much sense, but I guess you see the potential. This is especially cool if you want to set custom error status codes on error pages, create a feed, json response or whatever else you have in mind.
Using this notation works like a charm.