SellTrove's storefront API was returning product listings in 800ms at the 95th percentile. For a social commerce platform where speed affects conversion, this was unacceptable.
The investigation: CloudWatch traces showing time distribution across the request. 40% was database query time. 35% was image URL transformation (generating presigned S3 URLs for every product image on every request). 15% was JSON serialisation. 10% was network overhead.
The fixes: composite index on the products table's most common query path (database time dropped 65%). Presigned URL caching with a 1-hour TTL in Redis (image URL time dropped 90%). Response compression with Brotli (JSON serialisation overhead dropped 40%). CloudFront edge caching for the product listing endpoint with a 5-minute TTL.
Result: 95th percentile response time dropped from 800ms to 320ms. No rewrites. No new services. No new infrastructure components beyond a Redis key and a CloudFront cache behaviour.
Performance investigation before performance optimisation. Always.
— Dick Bassey | DevDick | 2025