PHPackages                             samjuk/m2-module-fetch-priority - 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. samjuk/m2-module-fetch-priority

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

samjuk/m2-module-fetch-priority
===============================

Adds ability to set fetch priority attributes, preload/prefetch links for admin content. As well as a public API for extension from 3rd party modules

v0.0.5(5mo ago)1225↓92.4%[1 issues](https://github.com/SamJUK/m2-module-fetch-priority/issues)MITPHPPHP ^7.4|^8.0CI failing

Since Feb 25Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/SamJUK/m2-module-fetch-priority)[ Packagist](https://packagist.org/packages/samjuk/m2-module-fetch-priority)[ RSS](/packages/samjuk-m2-module-fetch-priority/feed)WikiDiscussions master Synced yesterday

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

SamJUK\_FetchPriority
=====================

[](#samjuk_fetchpriority)

[![Supported Magento Versions](https://camo.githubusercontent.com/c10f194b5277b175992f69987ca7919141b2c45c2fa714ab14675d84e1179557/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6167656e746f2d322e342e36254532253830253933322e342e382d6f72616e67652e7376673f6c6f676f3d6d6167656e746f)](https://github.com/SamJUK/m2-module-fetch-priority/actions/workflows/ci.yml)[![CI Workflow Status](https://github.com/samjuk/m2-module-fetch-priority/actions/workflows/ci.yml/badge.svg)](https://github.com/SamJUK/m2-module-fetch-priority/actions/workflows/ci.yml)[![GitHub Release](https://camo.githubusercontent.com/e0719823f602c2713d765c8f15387a30dc09491cd072785dfd165d05364b3f59/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f53616d4a554b2f6d322d6d6f64756c652d66657463682d7072696f726974793f6c6162656c3d4c617465737425323052656c65617365266c6f676f3d676974687562)](https://github.com/SamJUK/m2-module-fetch-priority/releases)

This module adds options to set the fetch priority &amp; lazy loading attribute on images added via the admin area.

It also provides a simple API to add preload &amp; prefetch link tags to the header from other modules.

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

[](#installation)

```
composer require samjuk/m2-module-fetch-priority
php bin/magento setup:upgrade && php bin/magento cache:flush
```

Link Tag Usage
--------------

[](#link-tag-usage)

To use this module to add preload/prefetch link tags

### Example Preload Usage

[](#example-preload-usage)

```
class MyClassToAddPreloads
{
     public function __construct(
          private readonly \SamJUK\FetchPriority\Model\LinkStore $linkStore,
          private readonly \SamJUK\FetchPriority\Model\Links\PreloadFactory $preloadFactory
     ) { }

     public function execute()
     {
          // Do Stuff
          $preload = $this->preloadFactory->create([
               'href' => 'https://app.magento2.test/media/my_custom_entity/image1.jpg',
               'mimeType' => \SamJUK\FetchPriority\Enum\Preload\MimeType::ImageJPEG,
               'asType' => \SamJUK\FetchPriority\Enum\Preload\AsType::Image,
               'fetchPriority' => \SamJUK\FetchPriority\Enum\FetchPriority::High
          ]);
          $this->linkStore->add($preload);
     }
}
```

### Example Prefetch Usage

[](#example-prefetch-usage)

```
class MyClassToAddPrefetches
{
     public function __construct(
          private readonly \SamJUK\FetchPriority\Model\LinkStore $linkStore,
          private readonly \SamJUK\FetchPriority\Model\Links\PrefetchFactory $preloadFactory
     ) { }

     public function execute()
     {
          // Do Stuff
          $prefetch = $this->preloadFactory->create([
               'href' => 'https://app.magento2.test/media/my_custom_entity/image1.jpg',
          ]);
          $this->linkStore->add($prefetch);
     }
}
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance50

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~80 days

Total

5

Last Release

172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ee0b9faa791ec1a3b567e5e3668340aa9954c5f44ed536956d56ea3593584?d=identicon)[SamJUK](/maintainers/SamJUK)

---

Top Contributors

[![SamJUK](https://avatars.githubusercontent.com/u/7872420?v=4)](https://github.com/SamJUK "SamJUK (23 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/samjuk-m2-module-fetch-priority/health.svg)

```
[![Health](https://phpackages.com/badges/samjuk-m2-module-fetch-priority/health.svg)](https://phpackages.com/packages/samjuk-m2-module-fetch-priority)
```

###  Alternatives

[sebastianfeldmann/git

PHP git wrapper

497.8M21](/packages/sebastianfeldmann-git)[integer-net/magento2-sansec-watch

Sansec Watch integration for Magento 2

40206.6k](/packages/integer-net-magento2-sansec-watch)

PHPackages © 2026

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