feat: finish PARTIALs — HTTP cache headers + ISR revalidate webhook - #481
Merged
Conversation
Closes #80 (partial). Adds a per-route opt-in middleware that emits ETag, optional Vary, and Cache-Control headers on GET/HEAD responses, and short-circuits matching If-None-Match requests to 304 Not Modified. The buffering writer respects Cache-Control: no-store / private set by upstream handlers (the auth middleware's 401 responses, the admin REST surface's session-scoped reads) and falls back to a direct passthrough past Options.MaxBodyBytes to avoid materialising streaming endpoints in memory. POST/PUT/PATCH/DELETE pass through untouched — no allocation, no header munging. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
Closes #86 (partial). Adds an outbound HTTP webhook fired by apps/api/internal/rest/posts on create/update events that land or remove a row from "published" status. POSTs to {NEXT_REVALIDATE_URL}/api/revalidate?path=...&secret=... so the apps/web Next.js side can clear its ISR cache without waiting for the next revalidate interval. Configurable via: - GONEXT_NEXT_REVALIDATE_URL — apps/web origin - GONEXT_NEXT_REVALIDATE_SECRET — shared secret Either-empty disables the hook (chassis-without-renderer deployments). Notify failures are logged at Warn and swallowed — staleness for a few seconds is the right degrade behavior for a successful publish. The new revalidate.Client lives at packages/go/webhooks/revalidate rather than reusing packages/go/webhooks/delivery (which is the user-facing fan-out system with signed bodies + DLQ + retries). ISR revalidation is the opposite shape: single chassis-internal endpoint, fire-and-forget, best-effort. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80, #86.
Two PARTIAL items finished from triage:
(The fragment cache + comment-hook + queue-metrics scope from the original wave is left for a follow-up — the agent socket-died mid-implementation.)
🤖 Generated with Claude Code