Skip to content

Add cached PrettyBlocks zone rendering and invalidation#933

Merged
CySSoO merged 1 commit intomasterfrom
cyssoo/add-caching-method-in-everblockprettyblocks
Feb 2, 2026
Merged

Add cached PrettyBlocks zone rendering and invalidation#933
CySSoO merged 1 commit intomasterfrom
cyssoo/add-caching-method-in-everblockprettyblocks

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Feb 2, 2026

Motivation

  • Improve performance by caching final HTML output of PrettyBlocks zones keyed by zone + shop + lang + customer group.
  • Reuse the existing EverblockCache helpers to store and retrieve rendered HTML.
  • Ensure cache is invalidated when blocks or pages are changed so editors see updates immediately.

Description

  • Added EverblockPrettyBlocks::renderZoneWithCache(string $zoneName, Context $context, Module $module): string that builds a cache key (zone, shop id, lang id, customer group), uses EverblockCache::cacheStore / EverblockCache::cacheRetrieve, and returns the rendered HTML. (file: src/Service/EverblockPrettyBlocks.php)
  • Added EverblockPrettyBlocks::clearRenderCache() which delegates to EverblockCache::cacheDropByPattern using the new cache prefix. (file: src/Service/EverblockPrettyBlocks.php)
  • Wired shortcode rendering to use the cached renderer by calling EverblockPrettyBlocks::renderZoneWithCache from EverblockTools::getPrettyblocksShortcodes. (file: src/Service/EverblockTools.php)
  • Invalidate the render cache on persistent changes by calling EverblockPrettyBlocks::clearRenderCache() after an EverblockPage::save. (file: models/EverblockPage.php)
  • Invalidate the render cache from admin operations that modify PrettyBlocks (add/update/delete/duplicate/bulk actions) by adding invalidation calls and detection logic in the PrettyBlocks admin controller. (file: controllers/admin/AdminEverBlockPrettyblockController.php)

Testing

  • No automated tests were executed for this change.

Codex Task

@CySSoO CySSoO merged commit d7787dc into master Feb 2, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant