URL: /rules/perf/ttfb

---
title: "Time to First Byte"
description: "Measures server response time (TTFB)"
---

Measures server response time (TTFB)

| | |
|---|---|
| **Rule ID** | `perf/ttfb` |
| **Category** | [Performance](/rules/perf) |
| **Scope** | Per-page |
| **Severity** | warning |
| **Weight** | 7/10 |

## Solution

Time to First Byte (TTFB) measures how quickly your server responds. Slow TTFB indicates server/backend issues.

Thresholds (Core Web Vitals):
- Good: < 600ms
- Needs improvement: 600-1000ms
- Poor: > 1000ms

Fixes for slow TTFB:
- Enable server caching (Redis, Varnish, CDN)
- Optimize database queries
- Use CDN for static assets
- Upgrade server resources
- Reduce server-side processing
- Enable HTTP/2 or HTTP/3
- Use edge computing (Cloudflare Workers, Vercel Edge)

## Options

This rule supports the following configuration options:

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `good_threshold` | unknown | `undefined` | Good TTFB in ms |
| `poor_threshold` | unknown | `undefined` | Poor TTFB in ms |

### Configuration Example

```toml squirrel.toml
[rules."perf/ttfb"]
good_threshold = undefined
poor_threshold = undefined
```

## Enable / Disable

### Disable this rule

```toml squirrel.toml
[rules]
disable = ["perf/ttfb"]
```

### Disable all Performance rules

```toml squirrel.toml
[rules]
disable = ["perf/*"]
```

### Enable only this rule

```toml squirrel.toml
[rules]
enable = ["perf/ttfb"]
disable = ["*"]
```
