Configuring the Quicklink module

Last updated on
2 January 2022

Accessing Quicklink admin interface

The Quicklink module admin interface is located at
admin/config/development/performance/quicklink, and can be accessed from a tab on the development / performance settings page.

Menu item path to get to configuration form

The configuration form has five vertical tabs.

Tab: Prefetch Ignore Settings

These settings tell the Quicklink library which links to actively ignore (not prefetch).

First tab of the Quicklink configuration form

  • Do not prefetch admin paths -- Does not prefetch any links that have /admin or edit/. In addition, this looks at the parent elements of the hyperlinks, and if they are known administrative elements (e.g. Local tasks, or administrative toolbar), they will be excluded from prefetching.
  • Do not prefetch AJAX links -- Will not prefetch links that have a use-ajax CSS class, or end in /ajax.
  • Ignore paths with hashes (#) in them -- any anchor links will not be downloaded (e.g. https://example.com/path#heading)
  • Ignore paths with file extensions -- This will use regular expressions to look to see if the href attribute ends with a period followed by anywhere between 1 or 5 characters. These links will be ignored.
  • URL patterns to ignore (optional) -- Provides a textarea where the admin can input patterns, when if found in an href attribute will be ignored. Note that this does not support wildcard characters (e.g. * or regex).
  • Ignore these selectors (optional) -- Any additional selectors that you would like to not prefetch can go into this textarea (one per line).

Tab: Optional Overrides

This tab contains various overrides.

Second tab of Quicklink config

  • Override parent selector (optional) -- This will change the selector where Quicklink looks for hyperlinks to prefetch (by default this is the whole document).
  • Override allowed domains (optional) -- By default Quicklink will only prefetch links from the current domain. If you want to change this behavior, this is your setting. Note if you add a domain in this, you will have to re-add the current domain (assuming you still want links to be prefetched). Also note you can set this to true if you want Quicklink to prefetch everything.

Tab: When to Load Library

These settings will allow you to control when and where the Quicklink library will be loaded.

Third tab of Quicklink configuration

  • Prefetch for anonymous users only -- This is a highly recommended setting that will control whether or not Quicklink is enabled for authenticated users. It is highly recommended that this remains enabled as Drupal's caching is much more robust for anonymous users.
  • Do not prefetch during sessions -- This is checked by default and recommended. This is useful for modules such as Drupal Commerce that bypass caching by enabling a session (such as a shopping cart session).
  • Do not load library on these content types: -- Prevents the loading of the library on the specified content types.

Tab: Throttle Options

Throttle Options Tab

  • Set request limit - the total number of requests that can be prefetched for a given page. Set to 0 for unlimited. Warning: this may not work when Concurrency Throttle is also enabled (see https://github.com/GoogleChromeLabs/quicklink/issues/235).
  • Set concurrency throttle - Limit for the simultaneous requests that can be made while prefetching. Set to 0 for unlimited.
  • Set idle timeout value - Amount of time the browser must be idle before prefetching, in milliseconds. Default is 2000 ms.
  • Viewport Delay - Amount of time each link needs to stay inside the viewport before being prefetched. Default is 0 ms.

Tab: Prefetch Paths Only

Prefetch Paths Only tab

  • Prefetch these paths only (overrides everything else) -- This will override everything! Only the listed paths will be prefetched (and nothing else). Be sure to include a forward slash (e.g. /services/development).

Tab: Extended Browser Support

Extended browser support tab

This tab allows you to load various polyfills from polyfill.io. Pollyfill.io is a free service from the Financial Times that uses browser detection to serve only the necessary amount of JavaScript to your browser.

You can view current browser support for this at Can I Use.

Tab: Debug

Fourth tab of Quicklink configuration

Enabling debug mode will output the 🚫 emoji on hyperlinks that are being ignored by Quicklink. In addition you can hover over these links to see a popup that shows why the particular link was being ignored.

Debug mode will also log a lot of useful information to the JavaScript console including why the library is or is not being loaded.

Help improve this page

Page status: No known problems

You can: