Validating a Previously Read Web Representation
A client can make a conditional request to learn whether a stored representation is still suitable, under the HTTP validator rules.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a static guide
A client stores an article and its entity tag. On a later read, a supplied condition can lead to 304 if the selected representation still matches. The client can then reuse stored content. HTTP cache validation explains when revalidation is needed.
Check the changed case
A revised representation can instead arrive in a fresh successful response with an updated validator. Clarify which representation each validator describes.[1]
Compare a saved validator with an updated representation
A client stores a representation and its entity tag. A later conditional GET can send that tag. If the current representation matches under the HTTP comparison rules, the response can be 304 and the client uses stored content. When it changes, the server can send the new representation. See HTTP request metadata.
First GET → 200 and tag v1
Next conditional GET while unchanged → 304
Update resource → later conditional GET with v1 returns new body and validator
Verify variant, status and body separately
A 304 is tied to the selected representation and should not be interpreted as a new empty resource. Test both matching and nonmatching conditions with a response-body check.