How to exclude all 301/302 responses from caching?

How to exclude all 301/302 responses from caching?
Need prevent accidental caching for all redirections

You can try to match response, not sure it will work though:

router.match({ 
    response: { statusCode: /30/ } }, 
    ({ cache }) => { cache({ edge: false }); 
})