Skip to content

HOLD: Add bust_cache param to fix stale featured workshops#1300

Open
maebeale wants to merge 2 commits intomainfrom
maebeale/fix-featured-workshops
Open

HOLD: Add bust_cache param to fix stale featured workshops#1300
maebeale wants to merge 2 commits intomainfrom
maebeale/fix-featured-workshops

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 2, 2026

What is the goal of this PR and why is this important?

  • Featured workshops on the home page can stop appearing due to a stale cache
  • The workshop ID cache (1 year TTL) is invalidated via before_save, which runs inside the save transaction — if another request repopulates the cache before the transaction commits, stale data persists indefinitely

How did you approach the change?

  • Added bust_cache=true URL param support to Home::WorkshopsController — deletes the cached IDs before re-fetching
  • Forwarded the param through the turbo frame in _workshops.html.erb so visiting /?bust_cache=true busts the cache server-wide
  • Added request spec covering the cache bust behavior
  • Documented in README under "Production Maintenance"

UI Testing Checklist

  • Visit / — featured workshops section loads normally
  • Visit /?bust_cache=true — featured workshops appear (cache refreshed)
  • Mark a workshop as featured, visit home — verify it appears (or bust cache if not)

Anything else to add?

  • The caching was introduced in Refactor dashboard lazy load #977 — only workshops use this pattern; stories, community news, and events query the DB directly
  • The before_save → transaction race condition is the root cause, bust_cache is a manual escape hatch

🤖 Generated with Claude Code

maebeale and others added 2 commits March 1, 2026 21:18
Featured workshop IDs are cached for 1 year and the before_save
invalidation can race with the save transaction, leaving stale data.
Visiting /?bust_cache=true now clears and repopulates the cache.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maebeale maebeale changed the title Add bust_cache param to fix stale featured workshops HOLD: Add bust_cache param to fix stale featured workshops Mar 2, 2026
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