From e3f154279c756c07f27e092dcdde01d2dd9f0199 Mon Sep 17 00:00:00 2001 From: grimlink Date: Thu, 1 Oct 2026 11:27:01 +0200 Subject: [PATCH] =?UTF-8?q?Don't=20load=20the=20bfcache=20handler=20script?= =?UTF-8?q?=20on=20Hyv=C3=A4=20themes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 + README.md | 3 +- etc/adminhtml/system.xml | 6 +- view/frontend/layout/default_hyva.xml | 9 +- .../templates/hyva/bfcache/handler.phtml | 178 ------------------ 5 files changed, 17 insertions(+), 188 deletions(-) delete mode 100644 view/frontend/templates/hyva/bfcache/handler.phtml diff --git a/CHANGELOG.md b/CHANGELOG.md index 632d155..82deca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [Unreleased] + +### Changed +- The bfcache handler script is no longer loaded on Hyvä themes. Hyvä handles bfcache restores natively (messages, cart drawer, menus and customer section data), so the script only duplicated that work. The bfcache response headers and URL exclusions still apply on Hyvä. +- The **Update Mini Cart on User Interaction** and **Auto Close Menu** settings now note that they have no effect on Hyvä themes. + +### Removed +- `view/frontend/templates/hyva/bfcache/handler.phtml`. + ## [2.3.0] - 2026-05-11 ### Added diff --git a/README.md b/README.md index 8df34e1..faad252 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ All values can be configured at Default, Website, and Store View scopes. - Yes: Mini cart updates only after user interaction when page is restored from cache (Default) - No: Mini cart updates immediately on page restore - Recommended "Yes" to maintain optimal Page Speed and Core Web Vitals scores -* **Auto Close Menu** - Automatically close open menus when page is restored from back/forward cache (for compatible themes). (Default: Yes) + - Has no effect on Hyvä themes, Hyvä reloads the mini cart natively on restore +* **Auto Close Menu** - Automatically close open menus when page is restored from back/forward cache (for compatible themes). (Default: Yes) Has no effect on Hyvä themes, Hyvä closes its menus natively on restore. * **Exclude URLs** - Optional configuration to exclude specific URL patterns from back/forward cache. Enter URL parts (substring), one per line. The extension automatically excludes non-cacheable URLs, so this is only needed for custom cached URLs that load private data via JavaScript. > [!IMPORTANT] diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 83cb140..cf7778b 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -84,7 +84,8 @@ Yes: Mini cart updates only after user interaction when page is restored from cache.
No: Mini cart updates immediately on page restore.
- Recommended "Yes" to maintain optimal Page Speed and Core Web Vitals scores. + Recommended "Yes" to maintain optimal Page Speed and Core Web Vitals scores.
+ Has no effect on Hyvä themes, Hyvä handles this natively. ]]>
@@ -92,7 +93,8 @@ Magento\Config\Model\Config\Source\Yesno + Has no effect on Hyvä themes, Hyvä handles this natively. ]]> diff --git a/view/frontend/layout/default_hyva.xml b/view/frontend/layout/default_hyva.xml index 9514561..f393f24 100644 --- a/view/frontend/layout/default_hyva.xml +++ b/view/frontend/layout/default_hyva.xml @@ -1,12 +1,7 @@ - - - + + diff --git a/view/frontend/templates/hyva/bfcache/handler.phtml b/view/frontend/templates/hyva/bfcache/handler.phtml deleted file mode 100644 index fc1c444..0000000 --- a/view/frontend/templates/hyva/bfcache/handler.phtml +++ /dev/null @@ -1,178 +0,0 @@ -require(BfCache::class); -$isCustomerLoggedIn = $bfcacheConfig->isCustomerLoggedIn() ? 'true' : 'false'; -$enableUserInteractionRefresh = $bfcacheConfig->isReloadMiniCartOnInteraction() ? 'true' : 'false'; -$autoCloseMenuMobile = $bfcacheConfig->autoCloseMenuMobile() ? 'true' : 'false'; -?> - - -registerInlineScript() ?> -registerInlineScript() has to be called directly after the closing script tag! There must be no other HTML in between. */ ?>