Where to Put Headers for Error Pages


#1

If an error occurs while rendering a page and Kirby shows the “something went wrong” page, where would be the ideal spot for me to have some headers be tacked on to indicate that this page shouldn’t be cached.

In Kirby 2, this was super easy with:

c::set('headers', [
    'error' => function($page) {
        header('Cache-Control: Cache-Control: no-cache, must-revalidate, max-age=0');
        header('Expires: Fri, 01 Jan 1990 00:00:00 GMT');
    },
]);

Where would be the recommend spot to put this kind of thing in Kirby 3?