what's the point in telling the browser to preload stuff via headers if you have to wait a second for those headers because of output buffers?
as well as the additional manual HTML parsing to figure out what resources are in the doc
instead, consolidate scripts and styles and push them out via header
on the init
hook, save which resources are in posts in their meta then push out those via header
on the template_redirect
hook using the main query
that should cover the majority of pushable resources
in the meantime the browser knows as fast as possible to fetch them, and is busy processing the sent HTML as it comes in at the same time
and fewer server resources and memory spent
nevermind that all it takes is somebody being overeager flushing output buffers to ruin the entire thing