Does a 304 Response Mean Your Integration Should Replace Data with Nothing?

A polling integration retrieves a directory of partner resources and stores it locally. On its next request, the server responds without a new body. The integration interprets the empty response as an empty directory and removes every displayed entry. Nothing was deleted at the source; the client misunderstood a cache validation result.
This is the kind of defect that can survive ordinary success tests. The first full response works. The error appears only after the client begins making conditional requests.
Distinguish validation from replacement
HTTP Semantics, RFC 9110 defines 304 Not Modified for a conditional GET or HEAD that would otherwise have produced a 200 response. It lets the recipient use the stored representation instead of transferring its content again. A 304 response does not carry that representation's content.
For a business workflow, the consequence is that the client needs a matching stored representation. “No new body” and “the source now contains zero records” are different states and must not share the same update path.
Example: a resource directory
Suppose an illustrative directory response contains twelve resources. The client stores that representation with its validator. A later conditional request receives 304. The visible directory should still represent those twelve resources, subject to the cache's valid context and policy.
A genuine empty directory would be represented by the API's documented successful response containing an empty collection. Test both cases so the implementation does not conflate them.
Keep the validator attached to the data
Store the validator with the representation it validates and the relevant request context. A loose “last ETag” setting shared across several queries is not enough to identify which body may be reused.
The context may include the endpoint, query, selected language and other representation-selection details defined by the service. Authorization boundaries also require care: one account's cached data must not become another account's result merely because the URL looks similar.
Rehearse a missing local body
Create a controlled case where the validator remains but the corresponding stored data has been removed or cannot be read. Decide how the client recovers, such as making an appropriate unconditional request.
The important acceptance result is explicit recovery rather than silently treating missing local data as an empty source. Record whether the user sees the previous usable view, a loading state or a clear temporary failure while recovery runs.
Verify the update policy with three cases
Use a small fixture directory and capture three observations: an initial full response, an unchanged conditional response and a changed full response. Compare the local records after each step.
In the unchanged case, confirm that the integration does not issue deletion actions, blank a dashboard or generate a false “all resources removed” notification. In the changed case, confirm that it replaces or reconciles the representation according to the API's documented semantics.
Then test an authentication failure separately. An unauthorized response must not be interpreted as validation, and a cached view must not be used to bypass current access restrictions.
Keep logs focused on response status, cache identity, validator handling and the chosen branch. There is rarely a need to copy an entire private directory into a diagnostic message to explain this decision.
Explain freshness without inventing a new snapshot
A validation check can establish that a stored representation remains usable under the server's conditional-request behavior. It does not mean the client downloaded a new body. If the dashboard displays timestamps, distinguish the time of the latest check from the time the representation was first retrieved.
Document the recovery owner and the condition that triggers a full refresh. A small runbook entry should explain how to investigate a cache miss without clearing unrelated users' data.
For acceptance, ask the team to demonstrate that twelve stored resources remain twelve after an unchanged response, and that an explicitly empty successful response produces zero. This paired test turns a subtle HTTP distinction into an observable business rule.
Continue with the related FutureOS guide for the related planning decision.
The published FutureOS introduction describes the project as being in prelaunch. Use this guide to prepare a concrete project discussion; it does not announce an available FutureOS feature.
Prepared with AI assistance. Primary sources checked on October 24, 2026. Examples and procedures are illustrative editorial guidance, not FutureOS product announcements or an independently reviewed assessment.



Comments