Measure the request that is actually slow
Start with the browser network panel and server timings. Identify whether the delay comes from update_order_review, payment setup, shipping calculation, database queries or an external HTTP request. Optimizing the wrong page produces nice screenshots and no business impact.
External services often sit on the critical path
Shipping rates, tax services, payment methods, address validation and custom ERP calls can all block a checkout request. A slow remote API should not silently become your storefront response time.
Database work matters more as the store grows
Large carts, complex pricing rules, metadata-heavy products and historical order data can turn ordinary hooks into expensive queries. Profile SQL and PHP together; a query can be fast in isolation but executed hundreds of times.
Background work should stay in the background
Emails, exports, synchronization and non-critical enrichment should not delay the customer-facing response when they can safely run asynchronously. The design still needs failure handling and monitoring.
- Record a baseline for the same checkout scenario
- Profile dynamic requests, not only Lighthouse
- Measure external HTTP calls
- Inspect repeated queries and hook execution
- Test with realistic cart/order data
- Re-test after the change under the same conditions
