Trim your response × Don’t try to render all the elements at a time, use pagination or lazy loading. × Don’t return, what you don’t need. × Use transformer. (Fractal, Resource etc.)
Optimize Autoloader × Optimize your autoload file × Use either `composer dump-autoload -- optimize` Or `composer dump-autoload --classmap-authoritative`
Cache routes and configs × Cache your routes file- `php artisan route:cache` × Cache your config file- `php artisan config:cache` × Don’t use `env()` function
Use queue for expensive task × Use queue for long running task. × Use queue for CPU or memory intensive tasks. × Return early, if it’s possible. × Use a good monitoring tool. (Horizon)
Inspect Exceptions and Log × Use a good error reporting tool like Bugsnag, Sentry etc. × Log every possible failed scenario. × Use `logrotate` to manage log files. × Use benchmarking tool. (ab, wrk etc.)