noheader on the user/frontend side

You should be sending your header(s)/processing the request before the template loads.

In fact, a hook was added specifically for this: template_redirect