News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Speculative Loading

Started by MobileCS, May 28, 2025, 10:51:55 AM

Previous topic - Next topic

MobileCS

Link to the mod

Speculative Loading

Description

Speculative Loading optimizes how links are handled for faster page loading. It can be triggered by a mouse hover for early preloading or a mouse click for precise navigation.

It works by preloading resources for a page in the background before the user explicitly requests them, speeding up navigation and reducing wait times for subsequent loads.

The mod currently only works on recent posts, boards, topics, and page navigation links.

Supported Browsers: Chrome, Edge, Opera (approximately 70% of the global browser market).

Non-supporting browsers will simply ignore the speculation rules without any adverse effects.

Please be aware that the SpeculationRules API is experimental technology. It offers cutting-edge functionality, and may undergo changes or refinements.

It works on SMF 2.1.x only and it's compatible with SEF and Pretty URLs.

Features

  • Prefetch: Downloads all the necessary resources for a page in the background. (Default)
  • Prerender: The same as prefetching but also renders the page before users navigate to it.

Prefetching is safer for logged-in users since it only downloads the page without executing scripts.
Use Prerender at your own risk.

  • Mouse Hover: Boosts perceived performance by loading the next page before users click the link. (Default)
  • Mouse Click: May feel slower than hover but prevents premature content loading until users click a link.

How to Use

You can enable Speculative Loading by going to:

Admin -> Configuration -> Modification Settings -> Miscellaneous

Changelog

v1.0

  • Initial release

Advertisement: