Skip to content

feat: add ETag headers to KV read responses#21

Merged
skgbafa merged 1 commit intomainfrom
feature/etag-kv-responses
Feb 18, 2026
Merged

feat: add ETag headers to KV read responses#21
skgbafa merged 1 commit intomainfrom
feature/etag-kv-responses

Conversation

@skgbafa
Copy link
Contributor

@skgbafa skgbafa commented Feb 18, 2026

Summary

  • Expose existing Blake3-256 content hashes as ETag headers on KV read responses
  • Enables client-side caching for the TinyCloud CLI

Changes

  • Thread Hash through InvocationOutcome::KvRead (was Option<(Metadata, Content)>, now Option<(Metadata, Hash, Content)>)
  • get_kv() extracts the content hash from the kv_write entity
  • KVResponse responder sets ETag: "blake3-<hex>" header on every KV GET response
  • Added hex to server binary dependencies (already a workspace dep)

Details

The Blake3-256 hash was already computed and stored during KV writes (kv_write.value). This change simply threads it through to the HTTP response. No new hashing is performed.

ETag format: "blake3-<64-char-hex-digest>"

Not included

  • If-None-Match / 304 Not Modified support (planned follow-up)

Test plan

  • cargo check passes
  • KV GET responses include ETag header
  • ETag value is stable for unchanged content
  • ETag changes when content is updated

Expose the existing Blake3-256 content hash as an ETag header on KV
read responses. The hash was already computed and stored during writes;
this change threads it through InvocationOutcome::KvRead and sets
ETag: "blake3-<hex>" in the HTTP response.

Enables client-side caching for the TinyCloud CLI.
@skgbafa skgbafa force-pushed the feature/etag-kv-responses branch from 259360d to af881bb Compare February 18, 2026 13:31
@skgbafa skgbafa merged commit 0b757c5 into main Feb 18, 2026
13 checks passed
@skgbafa skgbafa deleted the feature/etag-kv-responses branch February 18, 2026 13:50
@skgbafa skgbafa restored the feature/etag-kv-responses branch February 24, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant