WordPress Cache Battles and Dashboard Lessons: When APIs Don't Clear What They Promise
Had one of those debugging sessions where the obvious solution doesn't work, so you have to get creative with filesystem manipulation and curl scripts.
The Varnish Cache Mystery
Spent way too long figuring out why majesticmirrorbooth.com/ was serving a stale hero subtitle even after successful Varnish PURGE commands. The response headers looked perfect: age: 0, x-cache: MISS - but the content was still old.
Turns out breeze_clear_all_cache() was silently failing to actually delete the Breeze cache files on disk. The WordPress function just... didn't work. So I built my own filesystem-level cache wipe using RecursiveIteratorIterator to manually delete all the HTML/PHP/gz files in wp-content/cache/. Immediately after the wipe, the plain URL served the correct subtitle.
Sometimes you just have to go around the API and talk to the filesystem directly.
Golden App Deployment Adventures
Propagated 4 critical fixes to the golden app via SSH since it doesn't have the REST API key in KV storage:
- Fixed the root cause bug in
front-page.php- added proper child theme directory checking withget_stylesheet_directory()before falling back to parent - Deployed the event name stripping and region suffix deduplication logic
- Created the missing
bbs-developer-child/directory - Deployed the updated child theme files (functions.php v1.0.7, front-page.php, and style.css)
Fun fact: scp kept erroring with "No such file or directory" even though the files definitely existed. Had to pipe everything through cat file | ssh "cat > path" instead. Sometimes the simple solution is the one that actually works.
Dashboard Lessons Integration
Fixed the lessons dashboard view that was trying to fetch from a local dev endpoint. Switched it to use WORKER_URL + '/lessons' to pull from Supabase via the hb-provision worker.
Then bulk imported 217 lessons from a markdown file using curl (Python urllib gets blocked by Cloudflare bot protection). Generated a bash script with 217 individual curl commands. The worker was returning 201 instead of 200 for successful creates, so my script initially thought everything failed - but all 217 lessons actually made it into Supabase just fine.
Technical Decisions That Stuck
Filesystem cache wipe over Breeze API: When the official WordPress function silently fails on Cloudways, direct file deletion becomes the reliable path.
Child theme staging: Created and deployed the child theme directory on the golden app even though it's not activated yet. The parent theme is fixed now, but having the child staged means future protected sites have everything ready to go.
Worker over Vercel functions: The dashboard already uses WORKER_URL for everything else. Adding a separate Vercel serverless function would just be unnecessary complexity.
What's Next
Need to commit changes in both repos (they're sitting uncommitted right now), expand the worker's tag whitelist beyond the current worker/deploy/auth/data/ui/general options, and fix that stubborn hp-cities-desc fallback that's still showing "From the Inland Empire to Orange County..." copy for sites that aren't in California.
Some days you're building new features, other days you're manually deleting cache files and piping data through SSH. Both are equally satisfying when they finally work.