New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

davidepedone/laravel-redis-fallback

Laravel 4 redis cache fallback to file
141 4

Larablocks Analysis

davidepedone/laravel-redis-fallback works with Laravel 4 (latest release v1.0.1, Mar 23, 2015), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4, past end of life
  • No release in the last 12 months (last: Mar 23, 2015)
  • 0 downloads a month (needs 10,000)
  • 4 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Mar 23, 2015.
  • No releases in the last 12 months.
  • First released: Mar 23, 2015.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.

Install
composer require davidepedone/laravel-redis-fallback
Latest Version:v1.0.1
PHP:>=5.4.0
Laravel:4
License:MIT
Last Updated:Mar 24, 2015
Links: GitHub  ·  Packagist
Maintainer: davidepedone

Redis cache fallback for Laravel4

If you use Redis as cache driver on Laravel 4 and for some reason Redis server became unavailable, you will end up with a Connection Refused exception. This package simply checks for the connection and if test fails, cache is switched to file driver. As soon as Redis come back it will be used again.

##How it works LaravelRedisFallbackServiceProvider class extends Illuminate\Cache\CacheServiceProvider and overrides register() method as follow:

	public function register(){

		$this->app->bindShared('cache', function($app){
			return new \Davidepedone\LaravelRedisFallback\LaravelRedisFallback($app);
		});
		...
	}

LaravelRedisFallback class extends Illuminate\Cache\CacheManager and overrides createRedisDriver() method as follow:


    protected function createRedisDriver() {

        $redis = $this->app['redis'];
        $redisStore = new RedisStore($redis, $this->getPrefix());

        try{

            $redisStore->getRedis()->ping();
            return $this->repository( $redisStore );

        }catch(\Exception $e){

            return parent::createFileDriver();
        }
        
    }

##How to use Install LaravelRedisFallback as a Composer package, adding this line to your composer.json:

"davidepedone/laravel-redis-fallback": "dev-master"

and update your vendor folder running the composer update command.

Replace the default cache service provider:

'providers' => array(
	...
	//'Illuminate\Cache\CacheServiceProvider',
	...
	'Davidepedone\LaravelRedisFallback\LaravelRedisFallbackServiceProvider'
	...
)

Enjoy!

Alternatives to davidepedone/laravel-redis-fallback

spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

480,267 592
awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

192,002 972
byerikas/cache-tags

Allows for Redis/Valkey cache flushing multiple tagged items by a single tag.

36,124 14
mostafaznv/laracache

LaraCache is a customizable cache trait to cache queries on model's events

59,023 273
padosoft/laravel-super-cache

A Laravel package for advanced caching with tags and namespaces in Redis.

11,776 3

Version History

Version Released PHP Laravel License
v1.0.1 >=5.4.0 4.2.* MIT