PHPackages                             egamipeaks/pizzazz - 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. [Caching](/categories/caching)
4. /
5. egamipeaks/pizzazz

ActiveLibrary[Caching](/categories/caching)

egamipeaks/pizzazz
==================

Laravel page caching

0.0.4(10mo ago)0383[4 PRs](https://github.com/egamipeaks/pizzazz/pulls)MITPHPPHP ^8.4CI passing

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/egamipeaks/pizzazz)[ Packagist](https://packagist.org/packages/egamipeaks/pizzazz)[ Docs](https://github.com/egamipeaks/pizzazz)[ GitHub Sponsors](https://github.com/EgamiPeaks)[ RSS](/packages/egamipeaks-pizzazz/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (10)Used By (0)

Laravel page caching
====================

[](#laravel-page-caching)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b30a199613d84189d00ca59f2e15d7cf8424b62604419cb233dc9ac29b47412f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6567616d697065616b732f70697a7a617a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/egamipeaks/pizzazz)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d9c7ffe563206ff35abb3ac72e3c54d2f9862802717b68fa47ad7ea1062ad32f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6567616d697065616b732f70697a7a617a7a2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/egamipeaks/pizzazz/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/58ece8c48dc654d1a35fb5ae227fb438a0959896329ab0b466a8f9396b399320/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6567616d697065616b732f70697a7a617a7a2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/egamipeaks/pizzazz/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)

Pizzazz is a Laravel page caching package that provides intelligent, full-page HTTP caching for your Laravel applications. It automatically caches GET requests and serves cached responses with configurable cache invalidation, query parameter filtering, and authentication-aware caching.

The package includes middleware for automatic caching, cache flushing utilities, and comprehensive logging to help you optimize your application's performance.

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

[](#installation)

You can install the package via composer:

```
composer require egamipeaks/pizzazz
```

You can publish the config file with:

```
php artisan vendor:publish --tag="pizzazz-config"
```

This is the contents of the published config file:

```
return [
    // Whether to enable Pizzazz
    'enabled' => env('PIZZAZZ_ENABLED', true),

    // Whether to enable debug mode
    'debug' => env('PIZZAZZ_DEBUG', false),

    // Add query vars that stop caching
    'disallowed_query_vars' => [],

    // Whether to cache authenticated requests
    'cache_authenticated_requests' => env('PIZZAZZ_CACHE_AUTHENTICATED_REQUESTS', false),

    // Minimum content length required to cache a page
    'min_content_length' => env('PIZZAZZ_MIN_CONTENT_LENGTH', 255),

    // Cache length in seconds. Default: 86400 seconds (1 day)
    'cache_length_in_seconds' => env('PIZZAZZ_CACHE_LENGTH', 86400),

    // Query arguments to include when caching
    'required_query_args' => [],
];
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

After installation, add the page cache middleware to your routes or route groups:

```
// In routes/web.php
Route::middleware('page-cache')->group(function () {
    Route::get('/', [HomeController::class, 'index']);
    Route::get('/about', [AboutController::class, 'index']);
    // Add more routes that should be cached
});
```

Or register the middleware globally in `app/Http/Kernel.php`:

```
protected $middleware = [
    // ... other middleware
    \EgamiPeaks\Pizzazz\Middleware\PageCacheMiddleware::class,
];
```

### Configuration

[](#configuration)

Configure caching behavior in your `.env` file:

```
PIZZAZZ_ENABLED=true
PIZZAZZ_DEBUG=false
PIZZAZZ_CACHE_AUTHENTICATED_REQUESTS=false
PIZZAZZ_MIN_CONTENT_LENGTH=255
PIZZAZZ_CACHE_LENGTH=86400
```

### Advanced Usage

[](#advanced-usage)

#### Programmatic Cache Control

[](#programmatic-cache-control)

```
use EgamiPeaks\Pizzazz\Pizzazz;

// Check if a request can be cached
$pizzazz = app(Pizzazz::class);
$canCache = $pizzazz->canCache($request);

// Get cached content
$cachedContent = $pizzazz->getCache($request);
```

#### Cache Flushing

[](#cache-flushing)

**Using Artisan Command**

Clear all page cache using the built-in artisan command:

```
php artisan pizzazz:flush
```

**Programmatically**

```
use EgamiPeaks\Pizzazz\Services\PageCacheFlusher;

// Flush all cached pages
$flusher = app(PageCacheFlusher::class);
$flusher->flush();
```

#### Custom Query Parameters

[](#custom-query-parameters)

Configure which query parameters should prevent caching:

```
// In config/pizzazz.php
'disallowed_query_vars' => ['utm_source', 'utm_medium', 'debug'],
```

Or specify required query parameters to include in cache keys:

```
// In config/pizzazz.php
'required_query_args' => ['locale', 'currency'],
```

### How It Works

[](#how-it-works)

1. **Automatic Caching**: The middleware automatically caches GET requests that return 200 responses
2. **Cache Keys**: Pages are cached using URL-based keys with optional query parameter filtering
3. **Cache Headers**: Cached responses include `X-Cache: HIT` header and `data-cached="true"` attribute on the body tag
4. **Smart Filtering**: Automatically skips caching for:
    - Non-GET requests
    - Authenticated users (unless configured otherwise)
    - Requests with disallowed query parameters
    - Responses shorter than the minimum content length
    - Non-200 HTTP responses

Testing
-------

[](#testing)

```
./vendor/bin/pest
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Andrew Krzynowek](https://github.com/egamipeaks)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance75

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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 ~0 days

Total

4

Last Release

302d ago

### Community

Maintainers

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

---

Top Contributors

[![egamipeaks](https://avatars.githubusercontent.com/u/646202?v=4)](https://github.com/egamipeaks "egamipeaks (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelEgamiPeakspizzazz

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/egamipeaks-pizzazz/health.svg)

```
[![Health](https://phpackages.com/badges/egamipeaks-pizzazz/health.svg)](https://phpackages.com/packages/egamipeaks-pizzazz)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[ryangjchandler/blade-cache-directive

Cache chunks of your Blade markup with ease.

202200.8k2](/packages/ryangjchandler-blade-cache-directive)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[innoge/laravel-policy-soft-cache

This package helps prevent performance problems with frequent Policy calls within your application lifecycle.

2356.9k](/packages/innoge-laravel-policy-soft-cache)[namoshek/laravel-redis-sentinel

An extension of Laravels Redis driver which supports connecting to a Redis master through Redis Sentinel.

38679.0k](/packages/namoshek-laravel-redis-sentinel)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)

PHPackages © 2026

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