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

ActiveLibrary[Caching](/categories/caching)

kevintew/imagecache
===================

Caching extension for the Intervention Image Class

05PHP

Since Aug 2Pushed 9mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

> This package is **abandoned** and will no longer be maintained.

Intervention Image Cache (Abandoned)
====================================

[](#intervention-image-cache-abandoned)

Intervention 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 Intervention 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 intervention/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 Intervention 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(

    [...]

    'Intervention\Image\ImageServiceProvider'
),

```

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

```
'aliases' => array(

    [...]

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

```

Usage
-----

[](#usage)

The Image Cache is best called by the static method `Image::cache` from the Intervention 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 Intervention 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)

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

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance41

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 79.8% 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.

### Community

Maintainers

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

---

Top Contributors

[![olivervogel](https://avatars.githubusercontent.com/u/884642?v=4)](https://github.com/olivervogel "olivervogel (67 commits)")[![jeremytubbs](https://avatars.githubusercontent.com/u/548888?v=4)](https://github.com/jeremytubbs "jeremytubbs (4 commits)")[![kevintew](https://avatars.githubusercontent.com/u/25177411?v=4)](https://github.com/kevintew "kevintew (4 commits)")[![pyrello](https://avatars.githubusercontent.com/u/709009?v=4)](https://github.com/pyrello "pyrello (2 commits)")[![riesjart](https://avatars.githubusercontent.com/u/23455176?v=4)](https://github.com/riesjart "riesjart (2 commits)")[![milewski](https://avatars.githubusercontent.com/u/2874967?v=4)](https://github.com/milewski "milewski (1 commits)")[![gluxon](https://avatars.githubusercontent.com/u/906558?v=4)](https://github.com/gluxon "gluxon (1 commits)")[![IgorUsoltsev](https://avatars.githubusercontent.com/u/5917245?v=4)](https://github.com/IgorUsoltsev "IgorUsoltsev (1 commits)")[![amirsadeghi1](https://avatars.githubusercontent.com/u/26359326?v=4)](https://github.com/amirsadeghi1 "amirsadeghi1 (1 commits)")[![nowshad7](https://avatars.githubusercontent.com/u/46539907?v=4)](https://github.com/nowshad7 "nowshad7 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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