Skip to content

Cache: invalidate core-table facades after native WordPress writes. - #1

Merged
JJJ merged 1 commit into
masterfrom
fix/native-write-cache-invalidation
Sep 21, 2026
Merged

JJJ merged 1 commit into
masterfrom
fix/native-write-cache-invalidation

Conversation

@JJJ

@JJJ JJJ commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

WordPress can update its own tables without going through a BerlinDB Query. A cached WPCoreTables\Queries\Posts read could therefore return the old title after wp_update_post(). Listen to WordPress's native mutation hooks and flush the affected facade cache groups, including by-ID rows and secondary lookups. The hook map covers posts, comments, users, terms, term relationships, metadata, options, and links.

On object-cache drop-ins without group-flush support, the plugin falls back to a full cache flush for correctness. This is a performance tradeoff for those drop-ins and is documented in the README.

Verified against WordPress 6.7, PHP 8.2, MariaDB 10.2, and core PR #259: 25 tests / 50 assertions, including native post, metadata, user, option, and term-assignment regression tests. PHPStan and Composer validation pass.

@JJJ
JJJ merged commit 164ab34 into master Sep 21, 2026
7 checks passed
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