I'm using Laravel 5.1 to make a REST API service, and i would like to lower the response time of the API.
There is somes solution to lower API response except the serveur performance ?
Actually the serveur respond in 250 ms. (In production)
My old API on Slim Framework responded in 170 ms.
Thank's.
First step of PHP optimization is enabling a bytecode cache engine OPcache.
As each PHP script is being compiled at runtime, a part of the execution time gets used for transforming the human readable code into code that can be understood by the machine.
A bytecode cache engine does it only once – during the first execution of a specific PHP file. Then the precompiled script is being stored in memory, which should lead to performance boosts in your PHP applications.
That is the reason why you have 300ms response time for the first request, and 100ms for all other requests.
Understanding OPcache: http://www.sitepoint.com/understanding-opcache/
Enabling OPcache: https://stackoverflow.com/a/17304671/1331425
PS. There's a nice dashboard for monitoring memory consumption - OPcache Dashboard:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With