rafaelstz/magento2-quicklink

View on GitHub
README.md

Summary

Maintainability
Test Coverage
<h1 align="center">
  <br>
    <img src="https://i.imgur.com/d8QEHRb.png" alt="Magento 2 Quicklinks" width="128" height="128" title="Magento2 quicklink"/> 
  <br>
  Magento 2 Quicklink Module
  <br>
  <a href="https://packagist.org/packages/rafaelcg/magento2-quicklink"><img src="https://img.shields.io/packagist/v/rafaelcg/magento2-quicklink.svg" alt="Magento 2 Quicklinks Stable Version"/></a>
  <a href="https://packagist.org/packages/rafaelcg/magento2-quicklink"><img src="https://img.shields.io/packagist/dt/rafaelcg/magento2-quicklink.svg" alt="Magento 2 Quicklinks Stable Version"/></a>
  <a href="https://travis-ci.org/github/rafaelstz/magento2-quicklink"><img src="https://travis-ci.org/rafaelstz/magento2-quicklink.svg?branch=master" alt="Magento 2 Quicklinks"/></a>
  <a href="https://codeclimate.com/github/rafaelstz/magento2-quicklink/maintainability"><img src="https://api.codeclimate.com/v1/badges/92e9c85f5f0ce91dbc4f/maintainability"  alt="Magento 2 Quicklinks"/></a>
</h1>

#### Faster subsequent page-loads by prefetching in-viewport links during idle time

## How does it works?

Magento 2 Quicklink module attempts to make navigations to subsequent pages load faster.

* **Detects links within the viewport** (using [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API))
* **Waits until the browser is idle** (using [requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback))
* **Checks if the user isn't on a slow connection** (using `navigator.connection.effectiveType`) or has data-saver enabled (using `navigator.connection.saveData`)
* **Prefetches URLs to the links** (using [`<link rel=prefetch>`](https://www.w3.org/TR/resource-hints/#prefetch) or XHR). Provides some control over the request priority (can switch to `fetch()` if supported).

## Install

### Via Composer 

Install using [Composer](https://getcomposer.org).

```
composer require rafaelcg/magento2-quicklink
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
```

## How to use

After installation, it will be enabled by default. You can find the configuration into `Stores > Configuration > General Web > Google Quicklink`.

[Rafael CorrĂȘa Gomes](https://github.com/rafaelstz)