QUICKLINK: Module for faster subsequent pageload
Tags: drupal, cms, opensource
Published: 2022-04-02 03:11:32

> _The probability of bounce increases 32% as page load time goes from 1 second to 3 seconds. - [Google](https://www.thinkwithgoogle.com/marketing-strategies/app-and-mobile/page-load-time-statistics/)_

One of the capabilities of modern browsers is [Link Prefetching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ). Link prefetching allows the browser to prefetch documents that the user might visit. And all this is done when the browser is idle.

**[Quicklink module](https://www.drupal.org/project/quicklink) provides a Drupal implementation of a lightweight javascript library called [Quicklink](https://github.com/GoogleChromeLabs/quicklink). Quicklink library is developed by [GoogleChromeLabs](https://github.com/GoogleChromeLabs) on link prefetching capability of browsers which allows faster subsequent page loads.**

## How Quicklink library work?

Now let's see how the Quicklink library works through the Quicklink module in Drupal.

1. Detect links in the viewport: Once the page loads Quicklink library detects links in the viewport with [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
2. Then it waits for the browser to be ideal using [requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback). This helps to make sure that other requests are not impacted.
3. The last check is to make sure the user is not on a slow or data-saver connection.
4. Now Quicklink library prefetches the links within the viewport using <link rel=prefetch>. And once you start scrolling it will start to fetch other links in the viewport.
5. Now if the user clicks any of the prefetched pages he/she will experience a fast page load with some drawbacks which we will talk about later.

## How to Install and configure the Quicklink module

Once the Qucklink module is downloaded and enabled, it will start working out of the box for the anonymous users with default settings.

Quicklink configuration settings can be found on “/admin/config/development/performance/quicklink”.

Quicklink module configuration is divided into the following sections:

1. Prefetch Ignore Settings
2. Optimal Overrides
3. When to Load Library
4. Throttle Options
5. Prefetch Paths Only
6. Extended Browser Support
7. Debug

Read more details: [https://www.drupixels.com/blog/quicklink-module-faster-subsequent-pageload](https://www.drupixels.com/blog/quicklink-module-faster-subsequent-pageload)

## Warning
Quicklink might seem like a great solution but it is not for everyone. Quicklink makes your website load faster but it does this by prefetching links which users might never open. And these unwanted page loads can have negative effects on servers with the unnecessary load.

You can find a really good example of why you should not use the quicklink module https://menetray.com/en/blog/improving-performance-drupal-quicklink-20

## Conclusion
Quicklink module might not be great for every website because of the negative effect on the server but it can do wonders if configured properly and used to load specific targetted links.

You need to make sure that you have balance between faster user experience with a quick page load for important pages and no negative server load because of prefetching links.

Full Read: [https://www.drupixels.com/blog/quicklink-module-faster-subsequent-pageload](https://www.drupixels.com/blog/quicklink-module-faster-subsequent-pageload)