I have ajax request that do 3 missions:
- Save Model (DB)
- Send Email
- Give success or failed message.
Because this mission takes too time. User can wait up to 20 sec for response (success or failed message). And if the user close the browser its stop in one of the operation that current process for the user.
This is bad user experience.
I want user submit his data to my Controller and after it he will get the “success or failed message”. And the process will be completely in the server side and its should support multi sessions.
How can I do that?
@hakre What you gave not reduce the time user wait for respond.
I found the best solution for this:
runactions extension for yii
This is extension let you run from controller background actions.
There are several way to use it. The best one for my case is this
And its work but without ajax request, When I make ajax request its not working for some reason.
So I used:
And its work great but its not the ideal solution for this.