惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
H
Help Net Security
I
Intezer
G
Google Developers Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Troy Hunt's Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
J
Java Code Geeks
S
Security Affairs
T
The Blog of Author Tim Ferriss
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
Docker
The GitHub Blog
The GitHub Blog
F
Full Disclosure
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs
腾讯CDC
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
T
Threatpost
D
DataBreaches.Net
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
L
LINUX DO - 最新话题
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
S
Securelist
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Help Net Security
Help Net Security
P
Proofpoint News Feed
Project Zero
Project Zero
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 叶小钗

Redis

Real-Time Fraud Detection: Latency, Features & Scale Context window in AI: why every token is a budget decision Connecting to Redis Cloud with AWS PrivateLink vs. VPC peering | Redis Redis Data Integration in Redis Cloud is now GA in AWS | Redis Why AI Misses Business Context & How Teams Fix It AI Reasoning Explained: Why Context Matters Semantic Layer vs Context Layer: Key Differences Redis array data type: How it works and when to use it Context Graphs vs. Vector Search: When RAG Falls Short What’s new in two – May 2026 edition Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more Redis 8.8: New array data structure & open source features How Conflict-free Replicated Data Types power active-active database replication Context Orchestration: What It Is & How It Works Context Compaction for AI Agents: A Complete Guide Prompt Bloat: Causes, Costs & Fixes for LLM Apps Agentic Retrieval Techniques: A Complete Guide Single-shot reliable consumers with XREADGROUP CLAIM in Redis 8.4 | Redis Long-Horizon AI Agents: Memory & State Infrastructure What is a context engine? What Is a Context Layer? AI Agent Infrastructure Context Retrieval for AI Agents: What It Is & Why It Matters Context Poisoning: How Bad Data Breaks Agent Reasoning Context is all you need: Introducing Redis Iris | Redis Context Engineering for AI: What It Is & How to Build It Dynamic endpoints: Migrate databases without changing your endpoint | Redis AI Shopping Assistants: How They Work & What to Build Endless Aisle Retail: Infrastructure & Real-Time Data LLM Speed Benchmarks: Metrics & Infrastructure Guide Context Pruning: Cut LLM Tokens Without Losing Quality What’s new in two – April 2026 edition Agentic AI Architecture: 5 Patterns Explained AI Agent vs Chatbot: Key Differences Explained Advantages of Building a Vector Search Solution API Latency in LLM Apps: Causes & How to Fix It Security advisory: [CVE‑2026‑23479] [CVE‑2026‑25243] [CVE-2026-25588] [CVE‑2026‑25589] [CVE-2026-23631] | Redis Edge Computing Latency: Causes & How to Reduce It AI Agents vs Workflows: When to Use Each Streaming LLM Responses: Make Your AI App Feel Fast Active-Active vs Active-Passive Database Architecture Prefill vs Decode: LLM Inference Phases Explained Long-Term Memory Architectures for AI Agents Speculative decoding: how it works & when to use it P95 Latency: What It Is & Why It Matters Why Multi-Agent LLM Systems Fail & How to Fix Them AI Human in the Loop: Production Oversight Patterns Native OpenTelemetry metrics for Redis client libraries | Redis Client-side geographic failover for Redis Active-Active | Redis Use Redis with SQL | Redis Introducing Redis Feature Form Build Google ADK Agents with persistent, real-time memory on Redis | Redis Startup Spotlight: Neuron Systems API Throttling: Algorithms, Patterns & Mistakes Agentic AI Examples Across 6 Industries Best Chunking Strategies for RAG Pipelines Agentic AI Guardrails: Controls That Work Redis joins AWS at GDC to support the next generation of gaming | Redis Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | Redis Real-Time Dispatch System: A Complete Guide P99 Latency: What It Means & How to Fix It Tokenization in LLMs: What AI App Devs Need to Know TTFT Meaning: What is Time to First Token? Atomic slot migration with Redis 8.4 Hybrid search benefits: Why your RAG system needs both keyword & vector search What’s new in two: March 2026 edition Vector embedding generators: How they work & how to use them Throughput-optimizing Redis for L2 KV Cache Reuse What is a data pipeline? Building AI agent pipelines that don't forget, fail, or fall apart Redis achieves Google Cloud Ready, Distributed Cloud status ahead of Google Cloud Next ‘26 | Redis Real-time network monitoring: what your data platform needs to keep up AI agent API: How agents connect to the real world What is multicloud infrastructure? A guide for 2026 What is a transaction monitoring system & how does it work? Why your AI agent fails in production & how tracing helps AI agent benchmarks: Where they fall short & why your infrastructure matters What is a JSON database (and when should you use one)? Introducing the Redis Partner Network: A new foundation for real-time innovation How real-time customer segmentation works in retail Payment orchestration & vault architecture in retail Agentic systems vs. GenAI: when generation isn't enough What is fuzzy matching? Semantic caching & routing: two powerful patterns for vector classification Redis alternatives: Why there are no exact substitutes Connect to Azure Managed Redis with Redis Insight 3.2.0 How to tame the thundering herd problem Redis to Manage Storage Replication | Redis How hierarchical navigable small world (HNSW) algorithms can improve search | Redis How leading financial institutions use Redis to drive growth | Redis What’s new in two: May 2025 | Redis Introducing Model Context Protocol (MCP) for Redis | Redis Redis vs. Elasticsearch: What’s faster for GenAI & vector search? | Redis Build fast, production-worthy AI apps with Spring AI and Redis | Redis Azure Managed Redis is GA today | Redis Redis then & now: Adapting with developers through every era | Redis Supercharge Your AI with OpenShift AI and Redis: Unleash speed and scalability | Redis What’s new in two: April 2025 | Redis Redis 8 is now GA, loaded with new features and more than 30 performance improvements | Redis What is a data strategy? 6 key components explained Data replication explained: types, examples & use cases
Time to First Byte Test: Tools, Causes & Fixes
Redis · 2026-04-23 · via Redis

If your pages feel sluggish, Time to First Byte (TTFB) is often where to look first. TTFB measures how long the browser waits before the server sends anything back. That wait sits at the front of the loading chain: before rendering, before subresource discovery, before Largest Contentful Paint (LCP) can even begin. LCP tracks when the largest visible element on a page finishes rendering, and it can't start until that first byte arrives. A slow TTFB delays every metric that follows. This guide covers what TTFB measures, how to test it, what causes it to spike, and which fixes move the needle.

What TTFB actually measures

TTFB is the elapsed time from the moment a browser initiates a navigation to the moment the server sends its first byte back. That single number is actually several phases stacked in sequence:

  • Redirect time: Any HTTP redirects before the final request add a full round trip each.
  • Service worker startup: If a service worker intercepts the request, its startup time adds to the wait.
  • Domain Name System (DNS) lookup: The browser resolves the domain name to an IP address before it can open a connection.
  • Connection and Transport Layer Security (TLS) negotiation: The Transmission Control Protocol (TCP) handshake and TLS handshake for HTTPS happen before a single byte of content is exchanged.
  • Server processing: The time your server spends generating a response before it can start sending anything back.

Which phase is slow determines which fix applies, so measuring before optimizing matters.

Google's TTFB thresholds

Google evaluates TTFB at the 75th percentile per origin in Chrome User Experience Report (CrUX) data, using these thresholds:

  • Good: 800ms or less
  • Needs improvement: 800ms–1,800ms
  • Poor: over 1,800ms

If you're in the "needs improvement" or "poor" range, users are waiting for your server before the page has done any work at all.

Why TTFB matters for later metrics

TTFB isn't a Core Web Vital, but it sets the clock for the ones that are. Google measures page experience through three Core Web Vitals: Largest Contentful Paint (LCP), which tracks how long it takes for the main content to appear on screen; Interaction to Next Paint (INP), which measures how quickly the page responds when a user clicks or taps; and Cumulative Layout Shift (CLS), which captures how much the page jumps around while it's still loading.

None of those things can happen until the browser receives that first byte from the server. If the server takes 2 seconds to respond, the browser spends 2 seconds doing nothing, and every other metric starts its clock 2 seconds late.

The field data shows the gap clearly: sites with poor LCP have a 75th-percentile TTFB of 2,270ms, while sites with good LCP have a median TTFB around 600ms. Faster server response doesn't guarantee good scores across the board, but a slow one makes them nearly impossible.

Database

Get started with Redis for faster apps

Reduce latency and handle data in real time.

How to run a TTFB test

Two types of data are useful here. Field data reflects real user conditions (varying networks, devices, and locations) and shows what your actual audience experiences. Lab data runs under controlled conditions you define, which makes it repeatable and useful for debugging. The most reliable picture comes from using both.

PageSpeed Insights shows both in one report. Chrome DevTools breaks down per-request timing in the Network tab, including a dedicated TTFB row. WebPageTest lets you test from specific regions, which helps identify content delivery network (CDN) coverage gaps. For real-user monitoring in production, the Navigation Timing API and Google's web-vitals library both expose TTFB from actual sessions.

One thing to know: TTFB includes redirects in most definitions, so field data may show higher numbers than synthetic tools for the same page.

What causes slow TTFB

TTFB is a sum of phases, so the cause determines the fix. The four most common culprits are:

  • Database query latency: Slow queries are a primary cause of server response times exceeding 200ms. The N+1 problem, where fetching a list triggers a separate query for every item in it, can stack dozens of small queries into hundreds of milliseconds of wait time.
  • Server-side rendering (SSR): The page has to be fully generated before any bytes can be sent. The more work the server does per request, the later the first byte arrives.
  • Redirect chains: Each hop adds at least one full round trip, plus fresh DNS, TCP, and TLS overhead if the redirect crosses origins. A three-hop chain can cost several hundred milliseconds before the actual request even starts.
  • TLS version & geographic distance: TLS 1.2 requires two round trips for the handshake; TLS 1.3 cuts that to one. HTTP Archive data shows 108ms vs 289ms for CDN TLS negotiation at the 90th percentile. Geographic distance compounds this: physical infrastructure adds latency that can only be reduced by moving content closer to users.

Each of these maps directly to a fix in the next section.

Redis Cloud

Build faster with Redis Cloud

Get Redis up and running in minutes, then scale as you grow.

How to reduce TTFB

Once you've identified which phase is slow, the fix becomes clearer. The highest-impact changes tend to address the phases with the most headroom.

  • Deploy a CDN: CDNs cut TTFB two ways: edge nodes closer to users reduce connection latency, and edge caching can serve responses without hitting your origin server at all. For sites with a global audience, this alone can move TTFB from "poor" to "good."
  • Eliminate redirect chains: Every hop in a redirect chain adds a full round trip. Consolidating multi-hop chains into a single redirect reclaims that time before the actual request even starts.
  • Optimize database queries: Unindexed queries and the N+1 pattern are common sources of server processing time. Reducing the number of queries per request, or the cost of each one, directly reduces the server-processing phase of TTFB.
  • Use streaming SSR: Instead of waiting for the full page to generate before sending anything, streaming SSR sends HTML in chunks as it's ready. The browser starts work sooner.
  • Adopt HTTP/3 & TLS 1.3: TLS 1.3 cuts the handshake from two round trips to one. HTTP/3 over QUIC reduces head-of-line blocking at the connection level. Both are available through most CDNs.

In-memory caching sits across several of these: it reduces server processing time, cuts database round trips, and can serve cached responses without touching the origin at all.

Use in-memory caching

Memory-caching is a primary server response time optimization. When database or session lookups sit on your critical path, serving that data from RAM instead of disk can cut the server-processing phase from hundreds of milliseconds to single digits.

Redis is built for exactly this. Redis is a real-time data platform built for sub-millisecond data access, and capabilities like the cache-aside pattern can help keep the data layer from dominating TTFB. Common use cases include query caching (storing frequently requested results in memory), session storage (avoiding a database round trip on every authenticated request), and API response caching (serving repeated responses without regenerating them). Redis 8 introduced hash-field expiration for advanced session-management scenarios, letting you set time-to-live values on individual fields within a hash rather than expiring the entire key.

Redis Stack

Now see how this runs in Redis

Use Redis to power real-time data, retrieval, and caching at scale.

Most of the web still has a TTFB problem

With those fixes in mind, it's worth zooming back out to the bigger picture. In 2025, 55% of desktop sites and 44% of mobile sites have good TTFB, which means more than half of all mobile sites still fall short. The share of sites achieving good TTFB increased by 1% on desktop and by 2% on mobile since 2024, but the gap between mobile and desktop remains at 11 percentage points.

Getting your TTFB under 800ms across real-user traffic puts you ahead of the majority of mobile sites, where progress has been slow.

Faster server response starts with faster data

TTFB affects every performance metric that follows. A slow server response delays First Contentful Paint (FCP), delays LCP, and delays when the browser can start working with the page.

One of the biggest levers for reducing the server-processing component of TTFB is data retrieval speed. Redis is a real-time data platform that keeps frequently accessed data in memory, reducing the disk I/O that slows server response times. Cache-aside patterns, session stores, and API response caching can help keep your data layer within its latency budget rather than consuming it on every request.

Redis combines caching, session management, and data retrieval in a single platform, so you don't need to stitch together multiple tools to keep server response times low. Try Redis free to see how it handles your caching workload, or talk to our team about reducing server response times across your infrastructure.