Do you find all information about us and our services?
Extensions by Category
1. 🚀 Introduction to the JaJuMa Back/Forward Cache Extension
By default, Magento 2 disables a powerful, native browser optimization called the Back/Forward Cache (bfcache).
This means that for a significant portion of user navigations - when they use their browser's back and forward buttons - your store is forced to reload pages from scratch, leading to unnecessary delays and a clunky user experience.
The JaJuMa Back Forward Cache extension solves this problem directly.
It re-enables this core browser feature for your Magento 2 store, unlocking its full potential for instant page loads, a dramatically improved user experience, and
better Core Web Vitals scores.
1.1 ⭐ Why bfcache is a Game-Changer for Magento 2 Performance
The Back/Forward Cache is fundamentally different from other caching layers you might be familiar with, such as Varnish or the browser's HTTP cache.
Instead of just storing individual files, bfcache takes a complete snapshot of a page - including its layout, scroll position, and the full JavaScript state - and stores it in the computer's memory (RAM) when a user navigates away.
When the user clicks the "back" or "forward" button to return, the browser doesn't need to request anything from the server or even rebuild the page from files stored on disk. It simply restores the entire page from this in-memory snapshot, resulting in a truly instantaneous page load. Think of it like pausing a video and instantly resuming it, versus stopping the video, finding it in your library, and starting it over from the beginning.
This is not a minor optimization.
Data from Chrome shows that 1 in 10 navigations on desktop and 1 in 5 on mobile are back or forward navigations.
By making these common actions instant, you significantly reduce friction and improve the overall perceived speed of your store.
The following table clarifies how bfcache provides a unique performance advantage compared to other caching mechanisms:
| Feature | Standard Navigation (No Cache) | HTTP Cache | Back/Forward Cache (bfcache) |
|---|---|---|---|
| Mechanism | Full network request, parsing, rendering | Network request (304 Not Modified) or local disk read | Instant restore from in-memory snapshot |
| Speed | Slowest | Fast | Instantaneous |
| Data Stored | Nothing | Individual file responses (CSS, JS, images) | Entire page state (DOM, JS Heap, scroll position) |
| Server Load | High | Low to Medium | Zero |
| Best For | First-time page visit | Repeat visits (non-bfcache) | Back/Forward button navigations |
1.2 📈 Boosting Your Core Web Vitals with bfcache
Improving your store's performance isn't just about making it feel fast;
it's about measurably improving the specific metrics Google uses to judge user experience and influence search rankings - the Core Web Vitals (CWV).
Enabling bfcache is one of the most powerful tools available for improving your site's
field data - the real-world performance data collected from your actual users.
Here’s how it directly impacts each core metric:
- Largest Contentful Paint (LCP):
LCP measures how quickly the main content of a page becomes visible. For pages restored from bfcache, the LCP is near-zero because the page is already rendered in memory. This provides the fastest possible LCP score for a large percentage of your users' page views. - Cumulative Layout Shift (CLS):
CLS measures the visual stability of a page during loading. Since bfcache restores a complete, fully rendered snapshot, it completely eliminates layout shifts during the restoration process. Pages loaded from bfcache have a CLS score of 0 for that navigation, which dramatically improves your site's overall CLS field data. - Interaction to Next Paint (INP):
INP measures a page's responsiveness to user input. Because a page is restored from bfcache with its JavaScript state intact, it is immediately interactive. This instant readiness ensures a seamless user experience and contributes positively to your INP score.
1.3 ⭐ Key Features & Compatibility
Our extension is engineered to provide a safe, seamless, and powerful bfcache integration. Here are the key features that make it possible:
-
Smart Auto-Exclusion:
Automatically prevents pages with dynamic, session-specific content (like the Cart, Checkout, and Customer Account areas) from being stored in the bfcache, ensuring data integrity. -
Intelligent Minicart Refresh:
To protect Core Web Vitals, the minicart is updated only after a user interacts with the page. This provides an instant page restore without the content flicker of an immediate AJAX request. -
Login State Protection:
If a user logs in or out, the extension detects this change upon page restoration. It automatically forces a page reload to ensure no stale or private data from a previous session is ever displayed. -
Clean UI on Restore:
Prevents a confusing user experience by automatically closing any open navigation menus when a page is restored from the bfcache, ensuring a clean and predictable page state. -
Developer Debug Tool:
A simple frontend overlay for logged-in admins shows the current bfcache status and performance metrics, making testing and verification effortless. -
Broad Compatibility:
Works out-of-the-box with standard Magento and is fully compatible with Hyvä Themes and Mage-OS. It also includes the necessary logic and guidance for stores using Varnish Cache.
Note:
All JaJuMa Extensions are compatible with Back/Forward Cache (bfcache) out-of-the-box.
This includes Matomo Analytics for Magento 2 as well as Auto Select Options for Magento 2
1.4 📜 How This Documentation is Structured
This documentation is designed to be a complete resource for users of all skill levels.
- All Users:
The documentation is broken down into key sections to guide you:- Configuration & Varnish Setup
provides a deep dive into every setting and explains the critical steps for stores using Varnish. - Testing, FAQ & Troubleshooting
helps you confirm your setup is working correctly and provides answers to common questions.
- Configuration & Varnish Setup
1.5 💻 How To Navigate The Extension in Magento Admin
To access the extension's main configuration panel and information, navigate to the following location in your Magento Admin backend:
Stores -> Configuration -> JaJuMa -> Back/Forward Cache
This will take you directly to the settings page where you can enable the extension and configure its behavior:
- General Settings
- Disable Back/Forward Cache For Specific Requests
- Config Varnish for Back/Forward Cache
📞 Need Help?
Still have questions or need help with your configuration? Our expert team is here to assist. Please don't hesitate to contact our support team for personalized assistance.
Ready to unlock these features for your store?
The JaJuMa Back Forward Cache is the key to instant navigations and a higher-ranking Magento store.
Find all you need to know and more valuable insights about Hyvä and Magento.
Expertly curated by JaJuMa:
Your central resource for everything Hyvä.
Your central resource for everything Magento.