Block Editor

The Block Editor module understands how blocks connect your pages: when a shared block, pattern, or template changes, exactly the affected pages are cleared. Without it, edits to shared content either leave stale pages in the cache or force a full flush.

Enable it under Settings → MilliCache → Modules → Block Editor. The module is site-scoped, so on multisite each site configures it individually.

What It Does#Copied!

The module tracks three kinds of block relationships, each with its own toggle:

Dynamic Blocks (default: on)#Copied!

Adds cache flags for blocks like Latest Posts and Query Loop, so pages embedding them are cleared when the underlying archive changes.

A page containing a Latest Posts block is tagged with the archive:post flag. A Query Loop block tags the page with archive:{post_type} for each post type it queries. When you publish a new post, MilliCache's normal archive invalidation clears these pages along with the real archives, so embedded post lists never go stale.

Synced Blocks (default: on)#Copied!

Tracks which pages use synced blocks (patterns). When a synced block is edited, all pages containing it are automatically cleared.

Every page embedding a synced pattern is tagged with a block:{id} flag. Saving the pattern clears exactly those pages, whether it is used on two pages or two thousand.

Site Editor Templates (default: off)#Copied!

Clears only the pages affected when you edit a template or template part in the Site Editor: editing a template clears the pages it renders, while editing a shared part (like a global header) still clears every page that uses it.

Pages are tagged with the template (tpl:{slug}) and every template part (pt:{slug}) that rendered them, including parts nested inside other parts. While this option is active, it also replaces MilliCache's default behavior of flushing the whole site when a template part is saved: the purge becomes precise instead of site-wide.

Note: The Site Editor Templates option only appears on block themes. Turn it on if you actively edit templates and parts in the Site Editor; otherwise leave it off to skip the extra cache tracking.

How the Flags Fit In#Copied!

All three features build on MilliCache's flag system. The module adds flags while pages are cached and clears by flag when the source content changes:

You edit Cleared pages
A synced pattern Every page embedding it (block:{id})
A post type with Query Loops Pages embedding a Query Loop for that post type (archive:{type}, via normal archive invalidation)
A Site Editor template Pages rendered by that template (tpl:{slug})
A template part Pages using that part, even nested (pt:{slug})

You can see these flags on any cached page in the Entries browser or in the X-MilliCache-Flags debug header.

Notes#Copied!

  • Dynamic and synced block tracking works on classic and block themes alike; only the Site Editor Templates feature requires a block theme.
  • Flags are added when a page is cached. After enabling the module, pages tagged with the new flags accumulate as the cache refills; clear the cache once to start fresh.

Next Steps#Copied!

Last updated: