Home > Mobile >  Does Laravel Api ressources affects performance (speed) of response and makes App slower?
Does Laravel Api ressources affects performance (speed) of response and makes App slower?

Time:12-07

I need to use the laravel api ressources to transform some attributes but i don't know how it affects the speed of the request especially if we have a large database.

CodePudding user response:

Laravel's resource classes allow you to expressively and easily transform your models and model collections into JSON. It should not make your app any slower than it already is. If your app is slower you can do the following.

  1. Edger Load relations
  2. Try to get large data in chunks using laravel's Chunk() method
  3. Indexing In Database frequent queries
  4. Cache where real-time data is not required
  5. Use Queue when required
  6. Cache Config, Routes
  7. Limit using third party packages
  8. JIT Compiler
  9. Optimize Composer Autoload
  10. Classmap optimization
  • Related