When a Laravel page feels slow, it's tempting to start looking for a framework-level fix.
But performance problems often come from the way the application is put together:
- Queries running inside loops (the N+1 problem).
- Loading more records and columns than the page needs.
- Missing database indexes.
- Doing expensive work during a request when it could happen in a queue.
- Repeating work that could be cached.
The important part is to measure before optimising. Check the query count, inspect the slow queries, look at the application logs and profile the request. Otherwise, it's easy to spend time optimising the wrong thing.
A framework gives you tools. Good engineering is knowing which part of the system actually needs attention.
What's the most common performance issue you've run into in a Laravel application?
Top comments (0)