[SOLVED] Does Laravel Api ressources affects performance (speed) of response and makes App slower?

Issue

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.

Solution

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

Answered By – Tipu Sultan Eiko

Answer Checked By – Senaida (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *