mage-os / module-theme-optimization

mage-os/module-theme-optimization

Page transitions and speculative loading rules for Magento

magento2-module Compatibility: Not yet tested Code Quality: Pending Tests: N/A Security: Pending OSL-3.0, AFL-3.0

Are you the maintainer of mage-os?

Packagento pulls mage-os's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Viewing version 2.0.0-alpha1. Latest version is 2.3.0. Switch to latest

MageOS_ThemeOptimization module

This module provides theme-related features to improve the performance of your Magento store, including:

  • Page transitions when navigating between pages on Magento
  • Speculative preloading of internal links on hover
  • Back/Forward Cache support for faster browser navigation

Installation details

To install the module, run the following commands in SSH, from the Magento root directory:

composer require mage-os/module-theme-optimization
php bin/magento setup:upgrade

Configuration

The module provides settings in the Magento Admin Panel under:

Configuration

The module provides settings in the Magento Admin Panel under: Stores > Configuration > Advanced > System

Speculative Loading

Enable Speculation Rules - Enables speculative loading to preload pages before links are clicked, making perceived load times faster. (Default: Yes)

Mode - Choose between prefetch and prerender modes. (Default: prefetch)

  • Prefetch: Downloads resources in advance
  • Prerender: Fully renders pages in advance (faster but may affect analytics data)

Eagerness Level - Controls how aggressively pages are preloaded. (Default: Moderate)

  • Conservative: Minimal preloading, only when very likely to be needed
  • Moderate: Balanced approach between performance and resource usage
  • Eager: Aggressive preloading for maximum user experience, at the cost of loading pages the user may never visit

Exclude URL Patterns - URL patterns to never preload. One pattern per line. (Default: customer, login, logout, auth, cart, checkout, search, download, redirect, rewrite, store, productalert)

  • URL patterns are matched against the request URI. We recommend entering part or full route paths, like "customer" (to exclude all customer pages) or "customer/account/logout" (to specifically exclude logout).

Exclude File Extensions - File extensions to never preload. (Default: pdf, zip)

Exclude Selectors - CSS selectors for links to never preload. Enter one selector per line. (Default: .do-not-prerender)

Back/Forward Cache

Note: bfcache availability may vary based on your Full Page Cache engine.

Enable Back/Forward Cache - Enable back/forward cache to store pages in browser memory temporarily for faster navigation. (Default: Yes)

Update Mini Cart on User Interaction

  • 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)

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.

All values can be configured at Default, Website, and Store View scopes.

There is no configuration for the Page Transitions feature. When installed, page transitions are always enabled for all Magento themes (frontend and admin panel).

Contributors

Original module contributed by @rhoerr.

Back/forward cache support was contributed by Oli Jaufmann and @JaJuMa.

Credit for the default speculation rules to David Lambauer and @run_as_root.

This module is sponsored and maintained by Mage-OS. Mage-OS makes it open source and freely available for use by any Magento 2.4+ or Adobe Commerce website.

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
2.3.0 stable Fail Magento 2.4.7-2.4.9 Details 2026-05-12 01:41:27
2.2.1 stable Not tested Not yet tested Details 2026-04-30 16:30:53
2.2.0 stable Not tested Not yet tested Details 2025-11-01 23:40:59
2.1.0 stable Not tested Not yet tested Details 2025-10-14 13:11:57
2.0.0 stable Not tested Not yet tested Details 2025-10-10 13:07:18
2.0.0-rc1 RC Not tested Not yet tested Details 2025-10-09 13:00:12
2.0.0-alpha3 alpha Not tested Not yet tested Details 2025-09-26 00:51:50
2.0.0-alpha2 alpha Not tested Not yet tested Details 2025-09-18 00:21:24
2.0.0-alpha1 alpha Not tested Not yet tested Details 2025-09-17 02:37:56
1.0.0 stable Not tested Not yet tested Details 2025-08-19 01:40:44

Requires 3

Package Constraint
php ~8.1.0||~8.2.0||~8.3.0||~8.4.0||~8.5.0
magento/framework ^103.0
magento/module-store *

Requires-dev 1

Package Constraint
phpunit/phpunit ^9.5||^10.0

No QA results yet

QA pipelines haven't run for this version. Compatibility and quality results appear here once the vendor publishes a tagged release that gets ingested.

License
OSL-3.0, AFL-3.0

More from mage-os

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.