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

ActiveLibrary[Caching](/categories/caching)

tojoo/imagecache
================

Caching extension for the Intervention Image Class

3.0.0(11mo ago)076MITPHPPHP ^8.1

Since Mar 9Pushed 11mo agoCompare

[ Source](https://github.com/tojoo-dev/intervention-imagecache)[ Packagist](https://packagist.org/packages/tojoo/imagecache)[ Docs](https://image.intervention.io)[ Fund](https://paypal.me/interventionio)[ GitHub Sponsors](https://github.com/Intervention)[ RSS](/packages/tojoo-imagecache/feed)WikiDiscussions 3.x Synced yesterday

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

Intervention Image Cache
========================

[](#intervention-image-cache)

> **Note:** This package extends and continues the development of the abandoned official [Intervention/imagecache](https://github.com/Intervention/imagecache) package. We released this fork to provide support for Intervention Image v3 and ensure continued compatibility with modern Laravel applications.

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/) (Laravel 8+). 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 tojoo/imagecache

```

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

### Laravel Integration

[](#laravel-integration)

For Laravel integration, you'll need to install the official Intervention Image Laravel package:

```
$ composer require intervention/image-laravel

```

This package provides the Laravel ServiceProvider and Facade for Intervention Image. After installation, the `Image` facade will be available and you can use the cache functionality as described in the usage section.

**Requirements:**

- PHP ^8.1
- Laravel ^8|^9|^10|^11|^12
- Intervention Image ^3.11

Usage
-----

[](#usage)

To create cached images just use the static method `ImageCache::cache` from facades 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 = ImageCache::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.

For enhanced development experience with IDE autocompletion and type checking, you can use the `ImageCacheInterface` contract to type-hint the callback parameter:

```
use Intervention\Image\Laravel\Facades\ImageCache;
use Intervention\Image\Interfaces\ImageCacheInterface;

$img = ImageCache::cache(
    function (ImageCacheInterface $image) {
        return $image->make('public/foo.jpg')
            ->resize(300, 200)
            ->greyscale()
            ->blur(5)
            ->sharpen(10)
            ->rotate(45)
            ->brightness(20);
    },
    60, // Cache for 60 minutes
    true // Return as Image object
);
```

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

43

—

FairBetter than 89% of packages

Maintenance50

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

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

###  Release Activity

Cadence

Every ~118 days

Recently: every ~420 days

Total

39

Last Release

353d ago

Major Versions

0.6.2 → 2.0.02014-05-17

1.0.0 → 2.0.22014-08-07

2.6.0 → 3.0.02025-07-15

PHP version history (5 changes)0.5.0PHP &gt;=5.3.0

2.5.0PHP ^7.2

2.5.1PHP &gt;=7.2

2.5.2PHP ~7.2|~8

3.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80017838?v=4)[k1ra](/maintainers/k1rana)[@k1rana](https://github.com/k1rana)

---

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)")[![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)")[![k1rana](https://avatars.githubusercontent.com/u/80017838?v=4)](https://github.com/k1rana "k1rana (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)")

---

Tags

image-cacheintervention-imagelaravellaravelimagegdimagickcachelibvips

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[unisharp/laravel-filemanager

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

2.2k3.5M85](/packages/unisharp-laravel-filemanager)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[intervention/image-laravel

Laravel Integration of Intervention Image

1588.9M182](/packages/intervention-image-laravel)[infocyph/intermix

A lightweight PHP DI container, invoker, serializer, and utility toolkit.

137.7k2](/packages/infocyph-intermix)

PHPackages © 2026

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