PHPackages                             nabu/yii2-compressr - 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. nabu/yii2-compressr

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

nabu/yii2-compressr
===================

v0.0.4(5y ago)013BSD-3-ClausePHPPHP &gt;=7.1.0

Since Nov 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/FeoOne/yii2-compressr)[ Packagist](https://packagist.org/packages/nabu/yii2-compressr)[ Docs](https://github.com/FeoOne/yii2-compressr)[ RSS](/packages/nabu-yii2-compressr/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Automatic Javascript, CSS and HTML combiner and minifier for Yii2
=================================================================

[](#automatic-javascript-css-and-html-combiner-and-minifier-for-yii2)

This extension provides ability to process and combine local assets, thus relieving the developer from having to strictly control what assets used in project and how they organized.

**This also makes the page load faster by reducing the page size and reducing the loading of additional files.**

#### Javascript

[](#javascript)

Extension combines all included .js files in a page, minifies it and include result to the page as a single .js file. This generated file is cached.

All inline javascript is minified and stays in the same place on the page. You can set option to cache this generated parts to prevent multiple generation of the same code parts.

#### CSS

[](#css)

Like javascript processing, all .css files are minified and included in the page as a single .css file. This generated file is cached.

All inline CSS is combined and minified. Like javascript processing, you can set option to cache this generated code parts.

#### HTML

[](#html)

Extension also provides ability to minify whole HTML on page. There are two generation strategies used in component:

- [mrclay](https://github.com/mrclay/minify)
- [tylerhall](https://github.com/tylerhall/html-compressor)

Install
=======

[](#install)

Add `"nabu/yii2-compressr": ">=0.0.4"` to `composer.json` or run

```
composer require --prefer-dist nabu/yii2-compressr ">=0.0.4"

```

Usage
=====

[](#usage)

```
[
    'bootstrap' => ['compressr'],
    'components' => [
    ...
        'compressr' =>
        [
            'class' => 'nabu\yii2\compressr\Compressr',

            'enabled' => true,              // enables component. possible use: 'enabled' => YII_ENV_PROD

            'compressJs' => true,           // compress and minify whole javascript on page
            'jsCutComments' => true,        // cut comments in javascript code
            'jsCacheInlineParts' => true,   // cache inline code parts. need the cache to be configured and enabled

            'compressCss' => true,          // compress and minify whole css on page
            'cssCacheInlineParts' => true,  // cache inline code parts. need the cache to be configured and enabled

            'compressHtml' => true,         // compress html
            // possible options: HtmlCompressStrategy::MRCLAY or HtmlCompressStrategy::TYLER
            'htmlCompressStrategy' => \nabu\yii2\compressr\html\HtmlCompressStrategy::MRCLAY,
        ],
    ]
]

```

Profile
=======

[](#profile)

First time heavy page called:

[![Profile](https://camo.githubusercontent.com/831b5d4473f068d1a9c15c4c664c6e5d5f457132afdda3be5e28cf25c0e2ba74/68747470733a2f2f66656f6f6e652e6769746875622e696f2f636f6d7072657373722d70726f66696c652d66697273742e706e67 "Profiling stats first call")](https://camo.githubusercontent.com/831b5d4473f068d1a9c15c4c664c6e5d5f457132afdda3be5e28cf25c0e2ba74/68747470733a2f2f66656f6f6e652e6769746875622e696f2f636f6d7072657373722d70726f66696c652d66697273742e706e67)

Subsequent times with caching:

[![Profile](https://camo.githubusercontent.com/c70b2c20319027a92cb4ad1339a3955803a0ba3c5b453475826bcc2b5503b014/68747470733a2f2f66656f6f6e652e6769746875622e696f2f636f6d7072657373722d70726f66696c652d63616368652e706e67 "Profiling stats first call")](https://camo.githubusercontent.com/c70b2c20319027a92cb4ad1339a3955803a0ba3c5b453475826bcc2b5503b014/68747470733a2f2f66656f6f6e652e6769746875622e696f2f636f6d7072657373722d70726f66696c652d63616368652e706e67)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

2016d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93130545cb2b44a595ee362d9ba92cc53ed5f743008279c8add2363ff1a92e1f?d=identicon)[Feo](/maintainers/Feo)

---

Tags

cssJShtmlprocesscompressorcompressyii2assetautoprocessor

### Embed Badge

![Health badge](/badges/nabu-yii2-compressr/health.svg)

```
[![Health](https://phpackages.com/badges/nabu-yii2-compressr/health.svg)](https://phpackages.com/packages/nabu-yii2-compressr)
```

###  Alternatives

[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[voku/html-min

HTML Compressor and Minifier

1804.7M39](/packages/voku-html-min)[sensiolabs/minify-bundle

Assets Minifier (CSS, JS) for Symfony &amp; Minify integration in Asset Mapper

5694.9k1](/packages/sensiolabs-minify-bundle)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)[lajax/yii2-asset-minifier

Runtime minification and combination of asset files.

1010.4k](/packages/lajax-yii2-asset-minifier)

PHPackages © 2026

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