Files
main.tsmain
What you'll learn
- Add etag() on a prefix and read the tag it computes from the body
- Send If-None-Match back and get 304 with no body and only the retained headers
- See a change to the resource change its tag, and pair the tag with Cache-Control: max-age
Press Run tests to start the app. Its log appears here.Graded endpoints
etag() hashes the body: a quoted SHA-1; the handler's Cache-Control rides along
If-None-Match matches: 304, no body, and the retained headers (the tag and Cache-Control)
A tag that does not match: the full response again
The stored cat changes; a PATCH response carries no tag, since only successful GETs are tagged
The old tag no longer matches the new body: 200 with a new tag
The new tag matches: 304 again
A 404 is not tagged; the handler's error body is answered as is
The same 404 from the PATCH route