A recent client came to us with a Laravel admin dashboard that took 8 seconds to load. They were losing internal productivity, and the public-facing pages were crawling too.
Six focused days later, we had it down to 2.3 seconds. Here is what we did.
Step 1 — Measure, do not guess
We installed Laravel Telescope and ran the dashboard through it. Immediately two problems appeared: 340 database queries on a single page, and 12 N+1 relationship loads.
Step 2 — Eager-load the relationships
The biggest single win. One with() call reduced queries from 340 to 41. Page load dropped from 8s to 4.1s. That is 49% from one line of code.
Step 3 — Add database indexes
Three columns used in every WHERE and ORDER BY had no index. Adding them cut query time by another 60%.
Step 4 — Cache expensive lookups
Some data (user roles, permissions, settings) never changes during a session but was being queried every request. We cached these for 10 minutes using Laravel's built-in cache driver.
Step 5 — Optimize images and assets
The dashboard was loading 8 MB of unoptimized images. We converted everything to WebP, added lazy loading, and gzipped CSS/JS. That alone saved 900ms on slower connections.
Step 6 — Queue the slow stuff
Report generation and email sending were blocking requests. We moved them to Laravel queues. Response times dropped another 400ms on average.
Final numbers
Performance work is unsexy. But every second you shave off is a user who does not bounce.