PHPackages                             pixelco/imagecache - 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. pixelco/imagecache

ActiveLibrary[Caching](/categories/caching)

pixelco/imagecache
==================

Caching extension for the Pixelco Image Class

v2.4.4(2mo ago)02MITPHPPHP ~7.2|~8

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/pixelco/imagecache)[ Packagist](https://packagist.org/packages/pixelco/imagecache)[ Docs](https://pixelcostudios.com)[ Fund](https://paypal.me/pixelcostudios)[ GitHub Sponsors](https://github.com/Pixelco)[ RSS](/packages/pixelco-imagecache/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Pixelco Image Cache extends the [Intervention Image Class](https://github.com/Intervention/image/) package to be capable of image caching functionality.

The library uses the [Illuminate/Cache](https://github.com/illuminate/cache/) package and can be easily integrated into the [Laravel Framework](https://laravel.com/). Based on your Laravel cache configuration you are able to choose between Filesystem, Database, Memcached or Redis for the temporary buffer store.

The principle is simple. Every method call to the Pixelco Image class is captured and checked by the caching interface. If this particular sequence of operations already have taken place, the data will be loaded directly from the cache instead of a resource-intensive image operation.

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

[](#installation)

You can install this package quickly and easily with Composer.

Require the package via Composer:

```
$ composer require pixelco/imagecache

```

Now you are able to require the `vendor/autoload.php` file to PSR-4 autoload the library.

### Laravel Integration

[](#laravel-integration)

The Image Cache class supports Laravel integration. Best practice to use the library in Laravel is to add the ServiceProvider and Facade of the Pixelco Image Class.

Open your Laravel config file `config/app.php` and add the following lines.

In the `$providers` array add the service providers for this package.

```
'providers' => array(

    [...]

    'Pixelco\Image\ImageServiceProvider'
),

```

Add the facade of this package to the `$aliases` array.

```
'aliases' => array(

    [...]

    'Image' => 'Pixelco\Image\Facades\Image'
),

```

Usage
-----

[](#usage)

The Image Cache is best called by the static method `Image::cache` from the Pixelco Image class.

To create cached images just use the static method `Image::cache` and pass the image manipulations via closure. The method will automatically detect if a cached file for your particular operations exists.

```
// run the operations on the image or read a file
// for the particular operations from cache
$img = Image::cache(function($image) {
   return $image->make('public/foo.jpg')->resize(300, 200)->greyscale();
});
```

Determine a lifetime in minutes for the cache file as an optional second parameter. Pass a boolean true as optional third parameter to return an Pixelco Image object instead of a image stream.

```
// determine a lifetime and return as object instead of string
$img = Image::cache(function($image) {
   return $image->make('public/foo.jpg')->resize(300, 200)->greyscale();
}, 10, true);
```

Server configuration
--------------------

[](#server-configuration)

If you have Static Resources caching enabled on Nginx please add your cache directory ({route} in config) to static resources handler exclusion:

```
# where "cache" is {route}
location ~* ^\/(?!cache).*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp|woff|woff2)$ {
  expires max;
  access_log off;
  add_header Cache-Control "public";
}

```

License
-------

[](#license)

Pixelco Imagecache Class is licensed under the [MIT License](http://opensource.org/licenses/MIT).

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance88

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

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

Total

2

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0206b277934926e48d56bbbd8aad0d033b682d13804ccdfcda93a39197ec2900?d=identicon)[pixelco](/maintainers/pixelco)

---

Top Contributors

[![pixelcostudios](https://avatars.githubusercontent.com/u/22494739?v=4)](https://github.com/pixelcostudios "pixelcostudios (5 commits)")

---

Tags

laravelimagegdimagickcache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pixelco-imagecache/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.1k3.4M80](/packages/unisharp-laravel-filemanager)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M158](/packages/intervention-image-laravel)[flarum/core

Delightfully simple forum software.

261.4M2.2k](/packages/flarum-core)

PHPackages © 2026

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