Skip to content

FlashcardNot attempted

Revalidation and 304

Recall it before you reveal

How does a browser revalidate a cached HTML page, and what does a 304 response mean?

Space to reveal
Show answer & explanation

The first response carried a validator: an ETag (a version tag) and/or Last-Modified. To revalidate, the browser sends a conditional request with the validator it has:

  • If-None-Match: "<etag>", or
  • If-Modified-Since: <date>.

If the resource hasn't changed, the server answers `304 Not Modified` with no body and the browser uses its stored copy. If it has changed, it answers 200 with the new body and new validators.

So no-cache HTML still costs a round trip on every visit, but usually only a few hundred bytes.