Time to First Byte (TTFB) is a web performance metric that measures the time from when a browser sends a request for a web page to when it receives the first byte of response data from the server. It encompasses network latency, server processing time, and the time it takes to begin sending data. TTFB is the foundational metric in page loading — nothing else can happen until the first byte arrives, making it the floor beneath which all other performance metrics cannot improve.
TTFB Score Thresholds
| Score | TTFB Time |
|---|
| Good | Under 800 milliseconds |
| Needs Improvement | 800ms – 1,800ms |
| Poor | Over 1,800ms |
These are Google's recommended thresholds. For ecommerce, where users are on mobile with variable connections, the faster the better — aim for under 400ms when possible.
What Causes High TTFB?
TTFB is high when:
- Server processing time is slow: Dynamic pages that query databases, fetch personalized content, or run complex logic before sending a response will have high TTFB.
- Hosting infrastructure is inadequate: Shared hosting or servers located far from your users add latency.
- No caching is implemented: If every page request requires a full database query and render cycle, TTFB will be consistently high.
- DNS resolution is slow: The DNS lookup that translates your domain to an IP address adds to perceived TTFB.
Why TTFB Matters for Ecommerce
TTFB sets the absolute minimum for how fast any page experience can feel. A page with TTFB of 2 seconds cannot have an LCP under 2 seconds — the server hasn't even responded yet. For Indian D2C brands running Shopify or custom ecommerce platforms, TTFB is often an overlooked root cause of poor Core Web Vitals scores. Optimizing images and JavaScript while ignoring TTFB is like fixing the plumbing while leaving the water turned off.
Poor TTFB is especially damaging on mobile networks in India where DNS lookups and TCP connections add significant overhead compared to fixed broadband. A user in a tier-2 city on a standard 4G connection might experience 200-400ms of network overhead before TTFB even begins — meaning a 1,500ms server TTFB translates to nearly 2 seconds before any page content starts rendering.
Real-World Example
A D2C nutraceutical brand running a custom Node.js ecommerce stack had a TTFB of 2.3 seconds on product pages. Investigation revealed that every product page load triggered three sequential database queries to fetch product data, inventory status, and personalized pricing — all without caching. Implementing Redis caching for product data (refreshed every 5 minutes) reduced TTFB to 340ms. This single infrastructure change improved their LCP from 5.8 seconds to 2.4 seconds, bringing them from a Core Web Vitals failure to near-passing, without touching a single image or JavaScript file.
How to Improve / Optimize TTFB
- Implement server-side caching: Cache product data, category pages, and other high-traffic, relatively static pages using tools like Redis, Varnish, or CDN edge caching.
- Use a CDN: A Content Delivery Network serves cached copies of pages from servers geographically close to users. For Indian ecommerce, using a CDN with Indian edge locations (Cloudflare, Fastly, AWS CloudFront with Indian POPs) dramatically reduces TTFB.
- Optimize database queries: Slow queries are a common cause of high server processing time. Profile your slowest queries and add indexes or optimize logic.
- Upgrade hosting infrastructure: If you are on shared hosting or an underpowered server, consider dedicated resources or a managed Shopify plan with Shopify's infrastructure optimizations built in.
- Use HTTP/2 or HTTP/3: Modern protocols reduce connection overhead, which improves the time from request initiation to first byte received.
TTFB in A/B Testing
TTFB affects A/B tests indirectly — if your testing tool adds script overhead that increases TTFB or LCP, it introduces a performance variable that can distort conversion test results. Use A/B testing platforms that inject scripts asynchronously and minimize main thread blocking to avoid this confound.
Run smarter A/B tests with CustomFit.ai — 14-day free trial, no credit card required.