Skip to content

Use weak ETag's when serving compressed content#1018

Merged
jviotti merged 2 commits into
mainfrom
wtag
Jun 5, 2026
Merged

Use weak ETag's when serving compressed content#1018
jviotti merged 2 commits into
mainfrom
wtag

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Jun 5, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jun 5, 2026

🤖 Augment PR Summary

Summary: This PR updates artifact serving to use weak ETags when the response is gzip-encoded, aligning validator strength with RFC 9110.

Changes:

  • Generate both strong ("<hex>") and weak (W/"<hex>") ETag forms from the metapack checksum.
  • Return a weak ETag when Accept-Encoding negotiation selects gzip; otherwise return a strong ETag.
  • Keep conditional request handling compatible by treating both ETag forms as cache hits.
  • Add E2E hurl coverage asserting strong ETags for identity responses and weak ETags for gzip responses.

Technical Notes: The checksum is computed over the identity payload at index time, so gzip wire bytes require weak validation semantics.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/router/artifact.cc
Comment thread test/e2e/html/hurl/etag.all.hurl Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/router/artifact.cc
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Index (community)

Details
Benchmark suite Current: 7baa9fc Previous: b6a5872 Ratio
Add one schema (0 existing) 387 ms 399 ms 0.97
Add one schema (100 existing) 30 ms 30 ms 1
Add one schema (1000 existing) 91 ms 93 ms 0.98
Add one schema (10000 existing) 739 ms 777 ms 0.95
Update one schema (1 existing) 22 ms 22 ms 1
Update one schema (101 existing) 31 ms 30 ms 1.03
Update one schema (1001 existing) 93 ms 92 ms 1.01
Update one schema (10001 existing) 749 ms 782 ms 0.96
Cached rebuild (1 existing) 7 ms 7 ms 1
Cached rebuild (101 existing) 9 ms 9 ms 1
Cached rebuild (1001 existing) 31 ms 31 ms 1
Cached rebuild (10001 existing) 272 ms 277 ms 0.98
Index 100 schemas 486 ms 572 ms 0.85
Index 1000 schemas 1375 ms 1475 ms 0.93
Index 10000 schemas 13895 ms 13778 ms 1.01
Index 10000 schemas (custom meta-schema) 137246 ms 135908 ms 1.01

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit 5fb937a into main Jun 5, 2026
5 checks passed
@jviotti jviotti deleted the wtag branch June 5, 2026 20:31
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Index (enterprise)

Details
Benchmark suite Current: 7baa9fc Previous: b6a5872 Ratio
Add one schema (0 existing) 388 ms 396 ms 0.98
Add one schema (100 existing) 32 ms 34 ms 0.94
Add one schema (1000 existing) 90 ms 91 ms 0.99
Add one schema (10000 existing) 856 ms 729 ms 1.17
Update one schema (1 existing) 24 ms 26 ms 0.92
Update one schema (101 existing) 32 ms 33 ms 0.97
Update one schema (1001 existing) 93 ms 91 ms 1.02
Update one schema (10001 existing) 758 ms 746 ms 1.02
Cached rebuild (1 existing) 8 ms 8 ms 1
Cached rebuild (101 existing) 9 ms 10 ms 0.90
Cached rebuild (1001 existing) 31 ms 30 ms 1.03
Cached rebuild (10001 existing) 259 ms 257 ms 1.01
Index 100 schemas 658 ms 496 ms 1.33
Index 1000 schemas 1646 ms 1580 ms 1.04
Index 10000 schemas 13985 ms 14527 ms 0.96
Index 10000 schemas (custom meta-schema) 145994 ms 153703 ms 0.95

This comment was automatically generated by workflow using github-action-benchmark.

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