Instant Navigation starts loading the next page while the visitor is still deciding to click, for example when they hover over a link or touch it. By the time the click happens, much of the page is already downloaded, so it opens almost instantly. Combined with page caching, this makes moving around your site feel very fast.
Available in: Powered Cache Premium
Where to find it: Powered Cache → Preload, in the Critical resources group
Requires: WordPress 6.8 or later for the Speculation Rules mode and for Prerender.
How Instant Navigation works #
Powered Cache uses one of two methods, depending on your WordPress version.
WordPress 6.8 and later: Speculation Rules API #
WordPress 6.8 added built-in speculative loading, based on the browser’s Speculation Rules API. Powered Cache does not add a second script. It configures the rules WordPress already prints: it sets the mode you choose, sets the eagerness to moderate (loading starts when a visitor hovers over a link or touches it), and adds your exclusions. Browsers that do not support the Speculation Rules API ignore the rules and navigate as usual.
Before WordPress 6.8: Quicklink #
On older WordPress versions, Powered Cache loads a small script based on Quicklink. It prefetches links on your own domain as they scroll into view, while the browser is idle. This method only prefetches. Quicklink is also used on WordPress 6.8 and later when custom code changes its options with the powered_cache_link_prefetch_options filter.
Turn on Instant Navigation #
- Make sure Page Cache is on, so early requests are answered from the cache.
- Go to Powered Cache → Preload.
- Turn on Instant Navigation (Load pages before visitors click).
- Choose an Instant Navigation Mode. Prefetch is right for most sites.
- Click Save Settings and clear the cache.
- To check it, open a page logged out in a Chromium-based browser, open the developer tools, and hover over a link while watching the Network tab. The linked page is requested before you click.
Instant Navigation is off by default. With an active license, Apply Recommended Settings turns it on.
New in 4.1: Link Prefetching is now called Instant Navigation. On WordPress 6.8 and later it uses the Speculation Rules API and starts loading when visitors hover over or touch a link, and you can choose between Prefetch and Prerender. Before 4.1, Quicklink was always used.
Changed in 4.0: Link prefetching is no longer on by default for sites that never saved this setting. If you relied on the old default, turn it on again.
Settings #
Instant Navigation #
Turns early loading of linked pages on or off. Default: off.
Instant Navigation Mode #
Chooses how much of the next page is prepared. Default: Prefetch.
| Mode | What happens before the click | Trade-offs |
|---|---|---|
| Prefetch | The browser downloads the HTML of the next page. Images, styles and scripts load after the click. | Safe for every site. The page opens noticeably faster, but not instantly. |
| Prerender | The browser loads and renders the whole page in the background, including its scripts. | Fastest: the page can appear instantly. Scripts such as analytics, ads and chat widgets run before the visitor arrives, which can count visits that never happen if those tools do not handle prerendering. Uses more memory and data on the visitor’s device and more requests on your server. |
Choose Prerender only if your analytics and marketing tools handle prerendered pages correctly, and compare your visit numbers after switching. Prerender needs WordPress 6.8 or later. Powered Cache also uses Prefetch instead when one of your cache exclusions is a regular expression that cannot be turned into a link rule (see Exclusions), because a prerendered page would run scripts on a page you excluded.
Exclusions and pages that are never loaded early #
Which links are skipped, and how you exclude more, depends on the method your site uses. See How Instant Navigation works.
Speculation Rules (WordPress 6.8 and later) #
These links are never loaded early:
- anything for logged-in users, and every link on sites that use plain permalinks (WordPress turns speculative loading off in both cases),
- links with a query string, such as
?add-to-cart=12, - the WordPress admin and login pages, and files in the uploads, plugins and themes folders,
- links with
rel="nofollow", - links that have the class
no-prefetch, or that are inside an element with that class (in Prerender mode,no-prerenderworks too), - WooCommerce cart, checkout and account pages,
- pages in your Never Cache URLs.
Never Cache URLs are applied when they are written as paths (/members/), paths with * wildcards (/members/*), or simple regular expressions such as /product/(.*). Full URLs on your domain are used by their path. Lines with a query string are skipped, because links with query strings are never loaded early anyway. A pattern that would match every page, such as /*, is ignored. A complex regular expression cannot be applied to links. In that case Instant Navigation still runs, but Prerender falls back to Prefetch.
To exclude a single link or a whole menu, add the CSS class no-prefetch to the link or to its container, for example with Advanced → Additional CSS class(es) on a block.
Quicklink #
Quicklink is used before WordPress 6.8. It is also used on WordPress 6.8 and later when custom code uses the powered_cache_link_prefetch_options filter. Quicklink loads nothing for logged-in users or on AMP pages. It skips links to other domains, feeds, the current page, the admin area, .php files, files in wp-content, links with a query string, and links with a ! in the path. On WooCommerce sites it also skips the cart, checkout and account pages.
Never Cache URLs, the no-prefetch class and rel="nofollow" do not apply in Quicklink mode. To skip more links, add a pattern to the ignores list of the powered_cache_link_prefetch_options filter. Each entry is a regular expression that is tested against the full link URL. Put the code in a small custom plugin or in your child theme’s functions.php file:
add_filter( 'powered_cache_link_prefetch_options', function ( $options ) {
// Skip every link whose URL contains /members/.
$options['ignores'][] = preg_quote( '/members/', '/' );
return $options;
} );
On WordPress 6.8 and later, any code on this filter switches Instant Navigation from Speculation Rules to Quicklink. Prerender and loading on hover then stop working. Use the filter only if your site already uses Quicklink, and remove it after you update to WordPress 6.8 if you want Speculation Rules.
Things to know #
- Each early load is a real request to your server. With page caching these requests are cheap, but pages that are not cached are built by WordPress each time. Keep Cache Preload on so most pages are cached.
- Exclude links that perform an action when opened, such as logout or “add to cart” links without a query string. With Speculation Rules, use a Never Cache URL or the
no-prefetchclass. With Quicklink, add the link to theignoreslist (see Quicklink).
For developers #
These filters apply to the Speculation Rules mode on WordPress 6.8 and later:
powered_cache_instant_navigation_eagerness: receives the eagerness (moderate) and the mode. Returnconservativeto start only when the visitor presses on a link, oreagerto start earlier. WordPress does not allowimmediatehere and replaces invalid values with its own default.powered_cache_instant_navigation_exclude_paths: receives the list of excluded path patterns. Patterns start with/, are relative to your home URL and may use*.
add_filter( 'powered_cache_instant_navigation_exclude_paths', function ( $paths ) {
$paths[] = '/members/*';
return $paths;
} );
add_filter( 'powered_cache_instant_navigation_eagerness', function () {
return 'conservative';
} );
Code can also ask for a specific URL to be prefetched with \PoweredCachePremium\LinkPrefetcher::prefetch( $url ). It works with both methods. See the Hooks Reference.