If you have a large class that executes after output(headers/text) is already sent, will that have any affect on your applications performance?
Edit: To clear things up, when output is sent, default headers are sent with it.
If you have a large class that executes after output(headers/text) is already sent, will that have any affect on your applications performance?
Edit: To clear things up, when output is sent, default headers are sent with it.
Headers slowing php code : i think no more than any other instructions, i may be wrong.
And the fact that output had already been send doesn't mean further code will run slower, or that would be a very strange behavior.
I suppose that you say that some content is already flushed out to the browser in which case, adding new headers may not have any impact on the previously sent headers - but doing something unnecessarily that doesnt affect anything will increase the overhead for sure(and for nothing). This is assuming that all the functionality that the "large class" does is to add headers.
You should consider re-arranging some code then.
The execution speed of the PHP will be the same regardless of whether the headers have been sent.
If you can send some HTML (for example the <head>
section) then it can actually make your page load faster, as the client can begin to download CSS and javascript files, and start to render the page if you send enough HTML.