PHPackages                             puklipo/laravel-vapor-gzip - 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. puklipo/laravel-vapor-gzip

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

puklipo/laravel-vapor-gzip
==========================

Gzip Response middleware for Laravel Vapor

1.4.0(1y ago)015.5k↓50%MITPHPPHP ^8.2

Since Apr 14Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/puklipo/laravel-vapor-gzip)[ Packagist](https://packagist.org/packages/puklipo/laravel-vapor-gzip)[ RSS](/packages/puklipo-laravel-vapor-gzip/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (13)Used By (0)

Gzip Response middleware for Laravel Vapor
==========================================

[](#gzip-response-middleware-for-laravel-vapor)

Requirement
-----------

[](#requirement)

- PHP ^8.2 (+ext-zlib)
- Laravel ^11.x

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

[](#installation)

```
composer require puklipo/laravel-vapor-gzip
```

### Slim skeleton (Laravel 11 or later)

[](#slim-skeleton-laravel-11-or-later)

Add to `bootstrap/app.php`

```
use Puklipo\Vapor\Middleware\GzipResponse::class;

->withMiddleware(function (Middleware $middleware) {
     $middleware->append(GzipResponse::class);
})
```

### Legacy kernel

[](#legacy-kernel)

Add to `app/Http/Kernel.php`

```
    protected $middleware = [
        // \App\Http\Middleware\TrustHosts::class,
        \App\Http\Middleware\TrustProxies::class,
        \Illuminate\Http\Middleware\HandleCors::class,
        \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
+       \Puklipo\Vapor\Middleware\GzipResponse::class,
    ];
```

Customize "When to encode with gzip?"
-------------------------------------

[](#customize-when-to-encode-with-gzip)

`App\Providers\AppServiceProvider`

```
use Illuminate\Http\Request;
use Puklipo\Vapor\Middleware\GzipResponse;

public function boot(): void
{
    GzipResponse::encodeWhen(function (Request $request, mixed $response): bool {
        return in_array('gzip', $request->getEncodings())
            && $request->method() === 'GET'
            && function_exists('gzencode')
            && ! $response->headers->contains('Content-Encoding', 'gzip')
            && ! $response instanceof BinaryFileResponse;
    });
}
```

When this package abandoned
---------------------------

[](#when-this-package-abandoned)

You can use just the `GzipResponse.php`. Copy to your Laravel project, and change namespace.

```
namespace App\Http\Middleware;
```

LICENSE
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance62

Regular maintenance activity

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~179 days

Total

12

Last Release

445d ago

PHP version history (3 changes)1.0.0PHP ^8.0

1.2.0PHP ^8.1

1.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ad636759509104bf5878387e07d13d90842667da8506dba1613d88d0ad7181a?d=identicon)[puklipo](/maintainers/puklipo)

---

Top Contributors

[![puklipo](https://avatars.githubusercontent.com/u/88759954?v=4)](https://github.com/puklipo "puklipo (29 commits)")

---

Tags

laravelvaporgzip

### Embed Badge

![Health badge](/badges/puklipo-laravel-vapor-gzip/health.svg)

```
[![Health](https://phpackages.com/badges/puklipo-laravel-vapor-gzip/health.svg)](https://phpackages.com/packages/puklipo-laravel-vapor-gzip)
```

###  Alternatives

[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[yajra/laravel-datatables-editor

Laravel DataTables Editor plugin for Laravel 5.5+.

1186.1M2](/packages/yajra-laravel-datatables-editor)[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/packages/statikbe-laravel-cookie-consent)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)

PHPackages © 2026

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