Cenoll Digital

How We Cut Our API Response Time by 70% in One Sprint

By Super Admin · Apr 18, 2026

Last quarter our search endpoint was averaging 1.4 seconds at p95. Two weeks later it was under 400 ms. Here\'s exactly what we changed.

Step 1 — Profile, don't guess

We turned on the Laravel Telescope query recorder and found a single query running 14 times per request. Eager loading dropped that to 1.

Step 2 — Add the missing indexes

Two foreign-key columns weren\'t indexed. Adding indexes alone took the worst query from 380 ms to 12 ms.

Step 3 — Cache the heavy aggregate

The slowest query was a count across three tables. Caching the result for 60 seconds made it effectively free.