Skip to content

Fix spec-compliance ordering issue on HTTP caching headers#1019

Merged
jviotti merged 3 commits into
mainfrom
cache-order
Jun 5, 2026
Merged

Fix spec-compliance ordering issue on HTTP caching headers#1019
jviotti merged 3 commits into
mainfrom
cache-order

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 fixes HTTP cache precondition ordering in artifact serving to better align with RFC 9110.

Changes:

  • Evaluates If-None-Match before If-Modified-Since and suppresses IMS whenever INM is present (per RFC 9110 §13.2.2 / §13.1.3).
  • Keeps the existing 304 response behavior when the ETag matches, including CORS handling.
  • Moves the If-Modified-Since short-circuit to only run when If-None-Match is absent.
  • Adds end-to-end hurl tests covering INM-vs-IMS precedence (including the non-matching INM + future IMS regression case).

Technical Notes: The new tests validate that a non-matching If-None-Match yields 200 even if If-Modified-Since would otherwise produce 304, and that IMS still works normally when INM is absent.

🤖 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. 1 suggestion posted.

Fix All in Augment

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

Comment thread src/router/artifact.cc 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 Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
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.

2 issues found across 2 files (changes from recent commits).

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

Re-trigger cubic

Comment thread src/http/include/sourcemeta/one/http_request.h
Comment thread src/http/include/sourcemeta/one/http_request.h
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: 4243951 Previous: 87a5ab6 Ratio
Add one schema (0 existing) 399 ms 418 ms 0.95
Add one schema (100 existing) 30 ms 28 ms 1.07
Add one schema (1000 existing) 91 ms 85 ms 1.07
Add one schema (10000 existing) 744 ms 688 ms 1.08
Update one schema (1 existing) 22 ms 27 ms 0.81
Update one schema (101 existing) 30 ms 28 ms 1.07
Update one schema (1001 existing) 93 ms 87 ms 1.07
Update one schema (10001 existing) 753 ms 697 ms 1.08
Cached rebuild (1 existing) 7 ms 6 ms 1.17
Cached rebuild (101 existing) 9 ms 8 ms 1.13
Cached rebuild (1001 existing) 31 ms 29 ms 1.07
Cached rebuild (10001 existing) 283 ms 248 ms 1.14
Index 100 schemas 657 ms 635 ms 1.03
Index 1000 schemas 1357 ms 1613 ms 0.84
Index 10000 schemas 13704 ms 13599 ms 1.01
Index 10000 schemas (custom meta-schema) 135611 ms 144866 ms 0.94

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

@jviotti jviotti merged commit 33ae7a4 into main Jun 5, 2026
5 checks passed
@jviotti jviotti deleted the cache-order branch June 5, 2026 21:24
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: 4243951 Previous: 87a5ab6 Ratio
Add one schema (0 existing) 388 ms 383 ms 1.01
Add one schema (100 existing) 35 ms 32 ms 1.09
Add one schema (1000 existing) 97 ms 88 ms 1.10
Add one schema (10000 existing) 778 ms 733 ms 1.06
Update one schema (1 existing) 27 ms 24 ms 1.13
Update one schema (101 existing) 35 ms 31 ms 1.13
Update one schema (1001 existing) 97 ms 90 ms 1.08
Update one schema (10001 existing) 792 ms 717 ms 1.10
Cached rebuild (1 existing) 8 ms 7 ms 1.14
Cached rebuild (101 existing) 11 ms 10 ms 1.10
Cached rebuild (1001 existing) 34 ms 30 ms 1.13
Cached rebuild (10001 existing) 286 ms 243 ms 1.18
Index 100 schemas 661 ms 670 ms 0.99
Index 1000 schemas 1629 ms 1638 ms 0.99
Index 10000 schemas 13903 ms 13767 ms 1.01
Index 10000 schemas (custom meta-schema) 142862 ms 141561 ms 1.01

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