HLS Playlist Returns 304: Normal Revalidation or a Stale ETag?
A playlist request marked 304 Not Modified is not, by itself, a failed HLS download. It can mean that a cache checked its saved copy and was told to reuse it. The question for a live stream is whether that saved text is still the correct representation.
We built two local endpoints to separate these cases. One changed its ETag when its playlist changed. The other deliberately kept the same ETag after changing the content it would otherwise serve. Both produced 304 responses; only the broken endpoint left the browser reading the older playlist revision after the origin state advanced.
Verification method — October 28, 2026: On Windows, a Node.js HTTP fixture served synthetic media-playlist text on a loopback address. Playwright launched bundled Chromium 156.0.8078.4 in headless mode with an isolated browser context. Each of two paths was fetched three times using fetch(url, { cache: 'no-cache' }); the server state changed from sequence 100 to 101 between the first and second request. Twelve assertions checked exposed Fetch statuses, returned sequence values, server response statuses and conditional request headers. This tested same-origin browser HTTP caching only. It did not load hls.js, fetch segments, decode media, run a live broadcast, test a CDN or inspect M3U8Online production traffic. The apparent stream paths and segment names were local fixtures, not public playable streams.
What the browser and server each reported
The server returned Cache-Control: no-cache on both paths. That permits storage but requires validation before reuse; it is not the same as forbidding storage. The browser's Fetch calls also requested validation through the no-cache mode.
| Endpoint and stage | Server's response | Fetch status / returned sequence | Meaning in this fixture |
|---|---|---|---|
| Correct ETag, first request | 200, "seq-100" | 200 / 100 | Browser obtained the initial text |
| Correct ETag, origin changed | 200, "seq-101" | 200 / 101 | Previous validator no longer matched |
| Correct ETag, origin unchanged | 304, "seq-101" | 200 / 101 | Browser reused the valid stored body |
| Fixed ETag, first request | 200, "fixed" | 200 / 100 | Browser obtained the initial text |
| Fixed ETag, origin changed | 304, "fixed" | 200 / 100 | Incorrect validation preserved old text |
| Fixed ETag, another check | 304, "fixed" | 200 / 100 | Revalidation did not repair the wrong validator |
The later requests included If-None-Match with the preceding ETag. In the broken case, the server's internal revision was 101, but it still treated "fixed" as a match. The cached text continued naming segment-100.ts; the updated representation would have named segment-101.ts.
Notice the different status observations: our server logged a wire-level 304 while the Fetch caller received a 200 response with a stored body. An application status and a server access-log status need not be the same observation. These results describe this Chromium cache path, not every HTTP library or every developer-tools display.
Read 304 as a cache decision
The HTTP model is that a successful validation lets a cache update and reuse an appropriate stored response. A 304 does not carry a replacement playlist body. If the validator falsely declares changed content equivalent, asking the same validation question again can keep selecting old data.
That is different from a 200 response containing an error page. If the body is HTML rather than a playlist, use our response-body diagnosis. If the playlist updates but its segments return 404, follow the stale-playlist versus missing-segment guide. Neither problem is established merely by seeing 304.
Capture a useful comparison
On a stream you own or are authorized to inspect, preserve the browser Network log before reproducing the symptom. Avoid starting with “Disable cache” enabled: that changes the behavior you are trying to observe. Record a normal run first, then use a cache-disabled run as a separate comparison.
- Identify the repeatedly requested media playlist, rather than assuming the initial multivariant playlist must change. Our playlist guide explains the distinction.
- Record the exact time, request URL identity,
If-None-MatchorIf-Modified-Since, response status and validator. Sanitize private query parameters before sharing the trace. - Compare the effective playlist text across observations: segment list, media sequence, any end marker and the publication timing expected from your pipeline. Keep the original saved body when interpreting a 304.
- If you operate the origin, compare the same selected representation with equivalent authorization and request headers there. An unrelated rendition, viewer account or cache key is not a valid control.
- Only then compare a bypassed or disabled-cache run. A difference narrows the investigation to the cache/validation path; it does not identify the faulty intermediary on its own.
A stable media-sequence value alone is insufficient evidence of a frozen playlist. A playlist can append entries without removing its first segment, and a completed presentation can legitimately stop changing. Compare the segment list and intended publication state, not a rule that every reload must increment one number. This fixture changed both sequence and segment name deliberately to make the old and new bodies easy to distinguish.
Preserve the body when checking with a command-line client
These example commands are for a shell with curl. Replace the reserved example URL with a permitted address and replace the validator with the exact ETag from the first response, including its quoting. They are diagnostic examples, not commands run against a production stream in our experiment.
curl -sS -D first-headers.txt -o first.m3u8 \
'https://stream.example.test/live/media.m3u8'
curl -sS -D check-headers.txt -o check-body.txt \
-H 'If-None-Match: "copied-validator"' \
'https://stream.example.test/live/media.m3u8'
If the second response is 304, an empty check-body.txt is expected; it is not evidence of an empty media playlist. The saved first.m3u8 remains the body whose validity was checked. A manually conditional curl request does not automatically reproduce a browser's stored-response handling. If the second response is 200, inspect its body and new validator instead. Header files and playlists can contain sensitive information; keep them private or sanitize them before sharing.
Decide what to fix from the evidence
| Evidence | Investigation | Avoid concluding |
|---|---|---|
| 304 and saved text matches the intended current body | Normal validation and reuse | That a redirection-class status is a playback failure |
| Origin representation changes but the same validator still validates old text | Validator generation and conditional-response logic | That changing only the player will repair the origin |
| Origin and delivery path disagree for equivalent requests | Cache keys, validators and intermediary policy | That every CDN location is affected |
| Fresh playlist text arrives but playback stops | Segment delivery, authorization, buffer and decoder evidence | That cache revalidation explains the stall |
For the deliberately broken endpoint, the repair is to make its validator describe the selected representation correctly and invalidate already affected cached entries as appropriate. A random query parameter on every request may hide the symptom while losing cache efficiency; it does not correct the underlying validation logic. Do not change signed URLs or blanket-disable caching across unrelated media objects as a diagnostic shortcut.
Our reproducible project check is npm run test-hls-cache-revalidation, now included in the publication gate. It uses bundled Chromium and a local server, needs no external stream and saves its report under coverage/content-review/hls-cache-revalidation.json. The result establishes a cache mechanism, not the cause of any particular production playback incident.