DEV Community

Cover image for QUICKLINK: Module for faster subsequent pageload
Gulab Bisht
Gulab Bisht

Posted on • Originally published at drupixels.com

QUICKLINK: Module for faster subsequent pageload

The probability of bounce increases 32% as page load time goes from 1 second to 3 seconds. - Google

One of the capabilities of modern browsers is Link Prefetching. 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 provides a Drupal implementation of a lightweight javascript library called Quicklink. Quicklink library is developed by 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.
  2. Then it waits for the browser to be ideal using 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 . 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

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

Top comments (0)