I am encountering some problems today in the application we are developping and refactoring. We currently have a huge "User" object that holds numerous information about the logged in user and his rights. Everything is done right after user login and is serialized in session. The serialisation starts to take some time now, plus I have found out that there is numerous __destruct scripts and such.
So with that in mind, I am trying to know if it is possible to have PHP do all those "closing" steps after the page has been served to the client, without keeping the HTTP connection open as it will show as the page is still loading and prevent some client-side code to execute.
It might help to know that I am running on Zend... I have tried to explicitly close the output buffer instead of waiting for php to do it at script end but the same problem persists. I have also closed the session to make sure it is not its fault but it prevents the User object to save itself in the session on its __destruct.
Thank you for your suggestions and/or explanations.
PS.: I know the whole thing has to be redone as it is not a very good way to do it, but we do not have the time for it just now.