Php function to set no cache header

need
php function to set no cache header for an array of job-post categories in wordpress
the category im trying to set headers for is mydomain.com/taxonomy/catname/

tried this , it doesn’t work

add_action( ‘template_redirect’,‘leo_stop’ );
function leo_stop() {
if( in_category( array( ‘explore’,‘category’,‘tag’) )) {
header('Cache-Control: no-store, no-cache, must-

revalidate, max-age=0’);
header(‘Pragma: no-cache’);
header(‘Expires: Thu, 01 Dec 1990 16:00:00 GMT’);
}
}
add_action( ‘send_headers’, ‘leo_stop’ );

Sponsor our Newsletter | Privacy Policy | Terms of Service