Glossary · Performance

Conditional Request

A conditional request is an HTTP request with headers like If-None-Match that lets a server answer 304 Not Modified instead of resending an unchanged file.

Updated October 21, 2026

A conditional request asks the server to act only if a condition holds. For caching, the client sends a validator it saved earlier, and the server compares it with the current version. If nothing changed, it replies with a tiny 304 response and no body.

Why it matters

Revalidating is far cheaper than redownloading. A 300 KB script that has not changed costs a few hundred bytes of headers instead of the full file, and the user's browser can reuse its local copy. It keeps content fresh without giving up most of the bandwidth savings.

Example

First response from the server:

HTTP/1.1 200 OK
ETag: "33a64df5"
Last-Modified: Wed, 07 Oct 2026 10:00:00 GMT
Cache-Control: max-age=0, must-revalidate

Later request from the browser:

GET /style.css HTTP/1.1
If-None-Match: "33a64df5"
If-Modified-Since: Wed, 07 Oct 2026 10:00:00 GMT

If unchanged, the server answers 304 Not Modified. Conditional headers also protect writes: If-Match on a PUT avoids overwriting someone else's edit, returning 412 when the version differs.

Common mistakes

  • Generating different ETags on each server in a cluster, so revalidation always fails.
  • Sending a 200 with the full body when the validator matches.
  • Forgetting that a 304 must still include the cache headers the browser should apply.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.