ETAG-IN-304
| Test ID | CAP-ETAG-IN-304 |
| Category | Capabilities |
| Type | Sequence (2 steps) |
| Scored | No |
| RFC | RFC 9110 §15.4.5 |
| RFC Level | SHOULD |
| Expected | 304 with ETag |
What it does
This is a sequence test — it verifies that a 304 Not Modified response includes the ETag header, allowing clients to update their cached validators.
Step 1: Initial GET (capture ETag)
GET / HTTP/1.1\r\n
Host: localhost:8080\r\n
Connection: keep-alive\r\n
\r\nCaptures the ETag header from the response.
Step 2: Conditional GET (If-None-Match)
GET / HTTP/1.1\r\n
Host: localhost:8080\r\n
If-None-Match: {ETag from step 1}\r\n
\r\nReplays the ETag value captured from step 1. If the server returns 304, this test checks whether the ETag header is present in that response.
What the RFC says
“A server generating a 304 response MUST generate any of the following header fields that would have been sent in a 200 (OK) response to the same request: … ETag” — RFC 9110 §15.4.5
Why it matters
Including the ETag in a 304 response lets clients confirm which representation they have cached and update their stored validator. Without it, clients may lose track of the ETag and fall back to unconditional requests.
Verdicts
- Pass — Step 2 returns
304with an ETag header - Warn — Server does not support ETags, or returns
304without an ETag header - Fail — Unexpected error (non-2xx/304 response)