vendredi 30 août 2019

does laravel do some process with the data returned in controllers before send?

I have a issue with the response time when load a lot of information (laravel models) with some relations, i am debugging, and the process of get the data from database take a litle bit of time, but when the response of controller is sent, it take more time and i dont know what is the problem, im doing some wrong?

First I thought that sending a lot of data in response could generate an increase in time, so I leaked the data and sent only what was necessary, this improved the time, but only a few seconds,

        $start = microtime(true);

        $current_user = $this->getCurrentUser();

        //Getting data from database
        $data = myFunction($current_user);

        $time_elapsed_secs = microtime(true) - $start;
        dd($time_elapsed_secs); //logs 2 seconds;

        return data; // but when i return data, it takes about 50 seconds 
                       in reaching the browser



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire