PHPackages                             dan0sz/resource-hints-magento2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dan0sz/resource-hints-magento2

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

dan0sz/resource-hints-magento2
==============================

Add `&lt;link rel='preconnect'&gt;`, `&lt;link rel='dns-prefetch'&gt;`, `&lt;link rel='prefetch'&gt;`, or `&lt;link rel='preload'&gt;` resource hints to Magento 2's head.

v1.2.1(3y ago)2298.6k—0%9[2 issues](https://github.com/Dan0sz/ResourceHints-magento2/issues)CC-BY-4.0PHP

Since Aug 27Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Dan0sz/ResourceHints-magento2)[ Packagist](https://packagist.org/packages/dan0sz/resource-hints-magento2)[ Docs](https://daan.dev)[ RSS](/packages/dan0sz-resource-hints-magento2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (6)Used By (0)

THIS EXTENSION IS NO LONGER ACTIVELY MAINTAINED
===============================================

[](#this-extension-is-no-longer-actively-maintained)

If it doesn't work on your Magento 2 instance, please fork this repo and fix it -- and feel free to submit a PR to add your changes to this repo.

Update January 31st, 2022: I've removed the Magento version requirements from composer.json so that you can try it on any instance. I'm not guaranteeing it'll work.

Resource Hints for Magento 2
============================

[](#resource-hints-for-magento-2)

Overview
--------

[](#overview)

Add ``, ``, ``, or `` resource hints to Magento 2's head.

Features
--------

[](#features)

- Tweak your Magento 2 store's performance by adding custom `preconnect`, `dns-prefetch`, `prefetch`, and `preload` headers.
- Enable/disable `crossorigin` attribute.
- Easily configurable at default, website and store view level (incl. sort order).

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

Installation using Composer is easy and recommended. From a terminal, just run:

`composer require dan0sz/resource-hints-magento2`

### Manually

[](#manually)

If you can't or dont want to use Composer, you can download the `master`-branch of this repository and copy the contents to `app/code/Dan0sz/ResourceHints`.

### After installation

[](#after-installation)

#### Developer Mode

[](#developer-mode)

- Run `bin/magento setup:upgrade`
- Done!

#### Production Mode

[](#production-mode)

- Run `bin/magento setup:upgrade`
- Run `bin/magento setup:di:compile`
- Run `bin/magento setup:static-content:deploy [locales e.g. en_US nl_NL]`
- Done!

Configuration
-------------

[](#configuration)

After installation a new tab is added to *Stores &gt; Configuration &gt; General &gt; Web* called *Resource Hints*.

### How does it work?

[](#how-does-it-work)

While most settings of this extension speak for themselves. The Resource column contains a few nifty tricks (thanks to @chedaroo), which will come in handy when e.g. Static content signing is enabled.

Values in the Resource column are assumed to be relative (local) assets. When a relative path is entered and **Static Content Signing** is **enabled**, e.g.

(*In these examples it is assumed that the default theme, Magento Luma is used.*)

- `YourName_ModuleName::path/to/file.ext` will resolve to `https://yourdomain.tld/static//frontend/Magento/luma/en_US/YourName_ModuleName/path/to/file.ext`, and
- `path/to/file.ext` will resolve to `https://yourdomain.tld/static//frontend/Magento/luma/en_US/path/to/file.ext`.

When **Static Content Signing** is **disabled**, the above mentioned values will resolve to:

- `https://yourdomain.tld/static/frontend/Magento/luma/en_US/YourName_ModuleName/path/to/file.ext`, and
- `https://yourdomain.tld/static/frontend/Magento/luma/en_US/path/to/file.ext` respectively.

When absolute URLs (prefixed by a protocol, i.e. `http://`, `https://` or `//`) are entered in the Resource column, no prior resolving will take place. E.g.

- `http://yourdomain.tld/path/to/file.ext`,
- `https://yourdomain.tld/path/to/file.ext`, and
- `//SomeVolume/path/to/file.ext`.

The examples above will all resolve to the same exact URL.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 75.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~313 days

Total

5

Last Release

1203d ago

PHP version history (2 changes)1.0.0PHP ~7.1|~7.2

1.1.0PHP 7.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2e019fb42c3ba635ae169ba79c36f1da6823ee5d8c7910bb0b500502e3bc258?d=identicon)[Dan0sz](/maintainers/Dan0sz)

---

Top Contributors

[![Dan0sz](https://avatars.githubusercontent.com/u/18595395?v=4)](https://github.com/Dan0sz "Dan0sz (22 commits)")[![jcarmona120](https://avatars.githubusercontent.com/u/24760725?v=4)](https://github.com/jcarmona120 "jcarmona120 (2 commits)")[![Leland](https://avatars.githubusercontent.com/u/714017?v=4)](https://github.com/Leland "Leland (2 commits)")[![chedaroo](https://avatars.githubusercontent.com/u/3003877?v=4)](https://github.com/chedaroo "chedaroo (1 commits)")[![rossmc](https://avatars.githubusercontent.com/u/2452991?v=4)](https://github.com/rossmc "rossmc (1 commits)")[![tig-daanvandenbergh](https://avatars.githubusercontent.com/u/36000627?v=4)](https://github.com/tig-daanvandenbergh "tig-daanvandenbergh (1 commits)")

### Embed Badge

![Health badge](/badges/dan0sz-resource-hints-magento2/health.svg)

```
[![Health](https://phpackages.com/badges/dan0sz-resource-hints-magento2/health.svg)](https://phpackages.com/packages/dan0sz-resource-hints-magento2)
```

###  Alternatives

[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[tig/postnl-magento2

TIG Magento 2 PostNL extension

58544.2k4](/packages/tig-postnl-magento2)[lillik/magento2-price-decimal

Magento 2 Price Decimal Precision

111147.5k](/packages/lillik-magento2-price-decimal)[nosto/module-nostotagging

Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.

27659.1k4](/packages/nosto-module-nostotagging)[magepal/magento2-customeraccountlinksmanager

Customer Account Links Manager for Magento2 allows you to quickly and easily remove unwanted links from customer account dashboard

4084.9k](/packages/magepal-magento2-customeraccountlinksmanager)[doofinder/doofinder-magento2

Doofinder module for Magento 2

13204.0k1](/packages/doofinder-doofinder-magento2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
