2017 © Pedro Peláez
 

library imagecache

Caching extension for the Intervention Image Class

image

intervention/imagecache

Caching extension for the Intervention Image Class

  • Monday, July 31, 2017
  • by olivervogel
  • Repository
  • 7 Watchers
  • 380 Stars
  • 1,072,557 Installations
  • PHP
  • 113 Dependents
  • 6 Suggesters
  • 67 Forks
  • 29 Open issues
  • 32 Versions
  • 7 % Grown

The README.md

This package is abandoned and will no longer be maintained., (*1)

~~Intervention Image Cache~~ (Abandoned)

Intervention Image Cache extends the Intervention Image Class package to be capable of image caching functionality., (*2)

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

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., (*4)

Installation

You can install this package quickly and easily with Composer., (*5)

Require the package via Composer:, (*6)

$ composer require intervention/imagecache

Now you are able to require the vendor/autoload.php file to PSR-4 autoload the library., (*7)

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., (*8)

Open your Laravel config file config/app.php and add the following lines., (*9)

In the $providers array add the service providers for this package., (*10)

'providers' => array(

    [...]

    'Intervention\Image\ImageServiceProvider'
),

Add the facade of this package to the $aliases array., (*11)

'aliases' => array(

    [...]

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

Usage

The Image Cache is best called by the static method Image::cache from the Intervention Image class., (*12)

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., (*13)

// 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., (*14)

// 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

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

# 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

Intervention Imagecache Class is licensed under the MIT License., (*16)

The Versions

31/07 2017

dev-master

9999999-dev http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

22/09 2015

2.3.3

2.3.3.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

11/08 2015

2.3.2

2.3.2.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

18/07 2015

2.3.1

2.3.1.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

24/05 2015

2.3.0

2.3.0.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

24/04 2015

2.2.0

2.2.0.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

08/04 2015

2.1.2

2.1.2.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

29/01 2015

2.1.1

2.1.1.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

28/01 2015

2.1.0

2.1.0.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

10/11 2014

2.0.6

2.0.6.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

27/09 2014

2.0.5

2.0.5.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

20/09 2014

2.0.4

2.0.4.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

25/08 2014

2.0.3

2.0.3.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

07/08 2014

2.0.2

2.0.2.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

21/05 2014

1.0.x-dev

1.0.9999999.9999999-dev http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

21/05 2014

1.0.0

1.0.0.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

20/05 2014

2.0.1

2.0.1.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

17/05 2014

dev-develop

dev-develop http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

17/05 2014

2.0.0

2.0.0.0 http://image.intervention.io

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cache image gd imagick

06/04 2014

0.6.2

0.6.2.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

25/03 2014

0.6.1

0.6.1.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

12/03 2014

0.6.0

0.6.0.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

07/02 2014

0.5.9

0.5.9.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

11/01 2014

0.5.8

0.5.8.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

10/01 2014

0.5.7

0.5.7.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

08/01 2014

0.5.6

0.5.6.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

15/10 2013

0.5.5

0.5.5.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

15/10 2013

0.5.4

0.5.4.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

29/05 2013

0.5.3

0.5.3.0 http://intervention.olivervogel.net/image/advanced/caching

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

29/03 2013

0.5.2

0.5.2.0 https://github.com/Intervention/imagecache

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

20/03 2013

0.5.1

0.5.1.0 https://github.com/Intervention/imagecache

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd

09/03 2013

0.5.0

0.5.0.0 https://github.com/Intervention/imagecache

Caching extension for the Intervention Image Class

  Sources   Download

MIT

The Requires

 

laravel cache image gd