php - Best Practice for Laravel Asynchronous Requests -
i have laravel application. application loading fine, when make 3-10 api per page in controller. now, start see latency when start making 200 api
requests per page in controller.
since laravel mvc.
all code in controller need executed , finished, , send data/variables view. leading lot of latency.
i’m thinking perform apis call asynchronously, not sure 1 best move,
i did quick search, found :
- php curl async: http://php.net/manual/en/function.curl-multi-init.php
- laravel async: https://laravel.com/docs/5.1/queues
- php promise: https://github.com/reactphp/promise
any directions/suggestions on mean lot me, , others faced issue.
explore using queues this. offload calls queue, await response.
i recommend against 200 requests per page, seems excessive. perhaps start trying down before rearchitecting.
Comments
Post a Comment