This module provides an implementation of Google Chrome Lab's Quicklink library for Drupal. Quicklink is a lightweight (< 1kb compressed) JavaScript library that enables faster subsequent page-loads by prefetching in-viewport links during idle time.
How Quicklink works
Quicklink makes navigation to subsequent pages faster. It:
- Works with all modern browsers (IE11 with the polyfill loaded)
- Detects links within the viewport (using Intersection Observer)
- Waits until the browser is idle (using requestIdleCallback)
- Checks if the user isn't on a slow connection (using
navigator.connection.effectiveType
) or has data-saver enabled (usingnavigator.connection.saveData
) - Prefetches URLs to the links (using
<link rel=prefetch>
).
What this module provides
This is a lightweight wrapper module that provides sensible defaults. Most sites will not need to modify any configuration.
- Inserts the Quicklink library — either off of a CDN, or off the filesystem (if present).
- Works with
Drupal.behaviors
to automatically prefetch URLs that get inserted via AJAX. - By default, loads the Quicklink library only for anonymous users.
- D7 only: By default, only loads if page caching and block caching are enabled.
- Option to disable loading the Quicklink library on individual content types.
- Has an option to disable loading the Quicklink library is PHP sessions are detected (useful for Drupal Commerce sites).
- By default, ignores the prefetching of administrative links, AJAX-enabled links, and links that end with a file extension.
- Provides option to ignore URLs with hashes (#) in them.
- Provides a field for URL patterns to ignore.
- Will not prefetch if a
noprefetch
hash or querystring parameter exists within the URL querystring. - Automatically ignores links that have a
noprefetch
ordownload
attribute. - Automatically ignores the
user/logout
link 😎. - Provides a field to include additional domains that Quicklink will prefetch from (other than the origin domain).
- Provides a debug mode checkbox that will help you figure out why or why not a link is getting prefetched.
- Option to load Intersection Observer polyfill so Quicklink will work with older browsers.
- Lots more!
Roadmap
The 2.0.x version is stable and supports both Drupal 8-11. The Drupal 7 version of the module is also stable.
Network requests being automatically downloaded while the user scrolls down the page.
Supporting organizations:
Attachment | Size |
---|---|
Quicklink downloading files | 884.67 KB |
Project information
- Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Developer Tools, Performance
- 2,792 sites report using this module
- Created by mherchel on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
2.0.4
released 14 July 2024
Works with Drupal: ^8 || ^9 || ^10 || ^11
✓ Recommended by the project’s maintainer.
Drupal 11 compatible
Install:
Development version: 2.0.x-dev updated 9 Sep 2024 at 01:17 UTC
7.x-1.1
released 24 June 2024
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Updates the target for the polyfill to more trustworthy operator.