Skip to content

Skip ETag header on cache_bust to prevent stale webhook syncs#987

Merged
jnunemaker merged 1 commit intomainfrom
claude/youthful-hugle
Mar 25, 2026
Merged

Skip ETag header on cache_bust to prevent stale webhook syncs#987
jnunemaker merged 1 commit intomainfrom
claude/youthful-hugle

Conversation

@jnunemaker
Copy link
Collaborator

Summary

  • When cache_bust: true is passed to Http#get_all (via webhook sync), skip the If-None-Match header so the server can't return a 304 with stale data
  • Previously, the _cb query param busted CDN caches but the ETag header still allowed the origin to short-circuit with 304 Not Modified, causing the local adapter to never get updated
  • Adds two specs: one verifying the header is omitted, and a regression test confirming fresh data is returned after a cache-busted sync

Test plan

  • Existing HTTP adapter specs pass (97 examples, 0 failures)
  • New spec verifies If-None-Match header is not sent when cache_bust: true
  • New regression spec verifies stale → fresh data transition on cache bust

🤖 Generated with Claude Code

When the webhook middleware triggers a sync with cache_bust: true, the
Http adapter was still sending the If-None-Match header with the cached
ETag. If the server returned 304 Not Modified, the adapter returned
stale cached data and the local adapter never got updated. This caused
5-10 minute delays for toggle changes to propagate in webhook mode.

Now when cache_bust is true, the If-None-Match header is omitted so the
server always returns a full 200 response with fresh data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jnunemaker jnunemaker merged commit 5e9e096 into main Mar 25, 2026
46 checks passed
@jnunemaker jnunemaker self-assigned this Mar 25, 2026
@jnunemaker jnunemaker deleted the claude/youthful-hugle branch March 25, 2026 16:48
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