PHPackages                             bnomei/kirby3-fingerprint - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. bnomei/kirby3-fingerprint

ActiveKirby-plugin[Parsing &amp; Serialization](/categories/parsing)

bnomei/kirby3-fingerprint
=========================

File Method and css/js helper to add cache-busting hash and optional Subresource Integrity to file

5.2.1(1y ago)4130.5k↓20.8%4[1 issues](https://github.com/bnomei/kirby3-fingerprint/issues)[3 PRs](https://github.com/bnomei/kirby3-fingerprint/pulls)1MITPHPPHP &gt;=8.2CI passing

Since Jul 24Pushed 1y agoCompare

[ Source](https://github.com/bnomei/kirby3-fingerprint)[ Packagist](https://packagist.org/packages/bnomei/kirby3-fingerprint)[ RSS](/packages/bnomei-kirby3-fingerprint/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (47)Used By (1)

Kirby Fingerprint
=================

[](#kirby-fingerprint)

[![Kirby 5](https://camo.githubusercontent.com/b1a1b2ccd58e96259a9722c2489d91f40378c01b6c4c3e9fd27ed1d12c269d7c/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f4b697262792f353f636f6c6f723d454343373438)](https://getkirby.com)[![PHP 8.2](https://camo.githubusercontent.com/fd050028b4459f3f6e4db5703412957375ceb180d27951213d421eb2a23c8c8e/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f5048502f382e323f636f6c6f723d3445354239332669636f6e3d706870266c6162656c)](https://camo.githubusercontent.com/fd050028b4459f3f6e4db5703412957375ceb180d27951213d421eb2a23c8c8e/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f5048502f382e323f636f6c6f723d3445354239332669636f6e3d706870266c6162656c)[![Release](https://camo.githubusercontent.com/0454f4a796491481651cda0785cf62b940195f137f4f4ae08fb9267bfce4b9da/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d66696e6765727072696e743f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)](https://camo.githubusercontent.com/0454f4a796491481651cda0785cf62b940195f137f4f4ae08fb9267bfce4b9da/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d66696e6765727072696e743f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)[![Downloads](https://camo.githubusercontent.com/32a2f937ff917fe153def17bd8af1f2a31349c2c00bdb62763b0342c1e3f6885/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f626e6f6d65692f6b69726279332d66696e6765727072696e743f636f6c6f723d3237323832322669636f6e3d676974687562266c6162656c)](https://camo.githubusercontent.com/32a2f937ff917fe153def17bd8af1f2a31349c2c00bdb62763b0342c1e3f6885/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f626e6f6d65692f6b69726279332d66696e6765727072696e743f636f6c6f723d3237323832322669636f6e3d676974687562266c6162656c)[![Coverage](https://camo.githubusercontent.com/951aeffac20d0762e5a7621d03b206392e809fe24ff9a50ffb7348fce509b2b1/68747470733a2f2f666c61742e62616467656e2e6e65742f636f6465636c696d6174652f636f7665726167652f626e6f6d65692f6b69726279332d66696e6765727072696e743f69636f6e3d636f6465636c696d617465266c6162656c)](https://codeclimate.com/github/bnomei/kirby3-fingerprint)[![Maintainability](https://camo.githubusercontent.com/1d240d750268d8f0e1d5b7130ee66186eaf09b29f60081a6612266ce72d745b1/68747470733a2f2f666c61742e62616467656e2e6e65742f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f626e6f6d65692f6b69726279332d66696e6765727072696e743f69636f6e3d636f6465636c696d617465266c6162656c)](https://codeclimate.com/github/bnomei/kirby3-fingerprint/issues)[![Discord](https://camo.githubusercontent.com/36eaef1b06f4996feb7587aa3281dcbd658e57535bc6b5e10110ed108e7a7a03/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f646973636f72642f626e6f6d65693f636f6c6f723d3732383964612669636f6e3d646973636f7264266c6162656c)](https://discordapp.com/users/bnomei)[![Buymecoffee](https://camo.githubusercontent.com/62e55d1129b82bf9c2fd4656451e81ab87a9787e7c9676ca58276532ed9666ee/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f69636f6e2f646f6e6174653f69636f6e3d6275796d6561636f6666656526636f6c6f723d464638313346266c6162656c)](https://www.buymeacoffee.com/bnomei)

File Method and css/js helper to add a cache busting hash and optional [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) to files.

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

[](#installation)

- unzip [master.zip](https://github.com/bnomei/kirby3-fingerprint/archive/master.zip) as folder `site/plugins/kirby3-fingerprint` or
- `git submodule add https://github.com/bnomei/kirby3-fingerprint.git site/plugins/kirby3-fingerprint` or
- `composer require bnomei/kirby3-fingerprint`

Usage
-----

[](#usage)

Warning

This Plugin does **not** override the build in `js()`/`css()` helpers. Use `css_f`/`Bnomei\Fingerprint::css` and `js_f`/`Bnomei\Fingerprint::js` when you need them.

```
echo css_f('/assets/css/index.css');
echo Bnomei\Fingerprint::css('/assets/css/index.css');
//  element with https://../assets/css/index.css?v=1203291283

echo js_f('/assets/js/index.min.js');
echo Bnomei\Fingerprint::js('/assets/js/index.min.js');
//  element https://../assets/js/index.min.js?v=1203291283

echo url_f('/assets/css/index.css');
echo Bnomei\Fingerprint::url('/assets/css/index.css');
// raw url https://../assets/css/index.css?v=1203291283

echo $page->file('ukulele.pdf')->fingerprint();
// https://../ukulele.pdf?v=1203291283

echo $page->file('ukulele.pdf')->integrity();
// sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC

// generate sri from local file
echo Bnomei\Fingerprint::js(
    '/assets/js/index.min.js',
    [
        "integrity" => true
    ]
);
/*

*/

echo Bnomei\Fingerprint::js(
    'https://external.cdn/framework.min.js',
    [
        "integrity" => "sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
    ]
);
/*

*/
```

Cache
-----

[](#cache)

Warning

If **global** debug mode is `true,` the plugin will flush its cache and not write any more caches.

Hash and SRI values are cached and only updated when the original file is modified.

For best performance, set either the [global or plugin-specific cache driver](https://getkirby.com/docs/reference/system/options/cache) to one using the server's memory, not the default using files on the hard disk (even on SSDs). If available, I suggest Redis/APCu or leave it at `file` otherwise.

**site/config/config.php**

```
return [
  'cache' => [
    'driver' => 'apcu', // or redis
  ],
  'bnomei.fingerprint.cache' => [
    'type' => 'apcu', // or redis
  ],
];
```

Similar Plugins
---------------

[](#similar-plugins)

The following plugins can do cache busting, but they do not cache the modified timestamp, nor can they do SRI, nor do cache busting for non-js/CSS files.

- [bvdputte/kirby-fingerprint](https://github.com/bvdputte/kirby-fingerprint)
- [schnti/kirby3-cachebuster](https://github.com/schnti/kirby3-cachebuster)
- [diverently/laravel-mix-kirby](https://github.com/diverently/laravel-mix-kirby)

Settings
--------

[](#settings)

bnomei.fingerprint.DefaultDescriptionhash`callback`will lead to the hashing logicintegrity`callback`use it to set option `'integrity' => null,`digest`'sha384'`Cryptographic digest to be used for SRI hashes either `'sha256'`, `'sha384'` or `'sha512'`.https`true`boolean value or callback to force *https* scheme on all but localhost enviroments.query`true` or `string` or `callback``myfile.js?v={HASH}`, `myfile.{HASH}.js` or loaded from manifest fileignore-missing-auto`true` or `false`silently ignore if an asset requested by @auto rule does not existabsolute`true` or `false`return the full URL of an asset or relative URLS based on site()-&gt;url()### Query option: true (default)

[](#query-option-true-default)

```
myfile.js?v={HASH}

```

This is the default since it works without additional changes to your server but be aware that [query strings are not perfect](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/).

### Query option: false

[](#query-option-false)

If you disable the query option, you also need to add Apache or Nginx rules. These rules will redirect CSS and JS files from with hash to the asset on disk.

**.htaccess** - put this directly after the `RewriteBase` statment

```
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.([0-9a-z]{32})\.(js|css)$ $1.$3 [L]

```

**Nginx virtual host setup**

```
location ~ (.+)\.(?:\w+)\.(js|css)$ {
    try_files $uri $1.$2;
}

```

### Query option: string (Manifest files)

[](#query-option-string-manifest-files)

You can also forward the path of a JSON-encoded manifest file, and the plugin will load whatever hash is defined there. This works great for [gulp-rev](https://github.com/sindresorhus/gulp-rev) or with [laravel mix versioning](https://laravel-mix.com/docs/master/versioning).

Disclaimer
----------

[](#disclaimer)

This plugin is provided "as is" with no guarantee. You can use it at your own risk and always test it before using it in a production environment. If you find any issues, please [create a new issue](https://github.com/bnomei/kirby3-fingerprint/issues/new).

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

Credits
-------

[](#credits)

- based on [@iksi](https://github.com/iksi)  (Kirby V2)
- [@S1SYPHOS](https://github.com/S1SYPHOS)  (Kirby V2)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance49

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.6% 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 ~59 days

Recently: every ~233 days

Total

43

Last Release

365d ago

Major Versions

1.2.0 → 2.0.02018-07-26

2.3.1 → 3.0.02019-08-26

3.2.0 → 5.0.02024-11-26

PHP version history (5 changes)2.2.2PHP &gt;=7.1.0

3.0.0PHP &gt;=7.2.0

3.0.13PHP &gt;=7.3.0

3.1.2PHP &gt;=7.4.0

5.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3265642?v=4)[Bruno Meilick](/maintainers/bnomei)[@bnomei](https://github.com/bnomei)

---

Top Contributors

[![bnomei](https://avatars.githubusercontent.com/u/3265642?v=4)](https://github.com/bnomei "bnomei (117 commits)")[![S1SYPHOS](https://avatars.githubusercontent.com/u/12161504?v=4)](https://github.com/S1SYPHOS "S1SYPHOS (6 commits)")[![philipmarnef](https://avatars.githubusercontent.com/u/1675017?v=4)](https://github.com/philipmarnef "philipmarnef (1 commits)")[![sirusdas](https://avatars.githubusercontent.com/u/8037179?v=4)](https://github.com/sirusdas "sirusdas (1 commits)")

---

Tags

cache-busterfingerprinthashkirbykirby-cmskirby-pluginkirby4kirby5subresource-integrityjsonhashassetskirbykirby-pluginkirby-cmssubresource-integritymanifestFingerprintcache-bustermanifest-file

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bnomei-kirby3-fingerprint/health.svg)

```
[![Health](https://phpackages.com/badges/bnomei-kirby3-fingerprint/health.svg)](https://phpackages.com/packages/bnomei-kirby3-fingerprint)
```

###  Alternatives

[bnomei/kirby3-security-headers

Kirby Plugin for easier Security Headers setup

276.6k](/packages/bnomei-kirby3-security-headers)[bnomei/kirby3-feed

Generate a Atom/JSON/RSS-Feed and XML-Sitemap from Pages-Collections

7224.8k](/packages/bnomei-kirby3-feed)[bnomei/kirby3-janitor

Kirby Plugin for running commands like cleaning the cache from within the Panel, PHP code or a cronjob

9339.9k2](/packages/bnomei-kirby3-janitor)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4144.1k1](/packages/bnomei-kirby3-dotenv)[johannschopplich/kirby-hashed-assets

File name hashes support for css() and js() helpers

231.5k](/packages/johannschopplich-kirby-hashed-assets)

PHPackages © 2026

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