PHPackages                             bokt/flarum-redis - 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. bokt/flarum-redis

Abandoned → [blomstra/flarum-redis](/?search=blomstra%2Fflarum-redis)Library[Caching](/categories/caching)

bokt/flarum-redis
=================

Adds Redis cache, sessions and queue to Flarum

0.4.2(4y ago)153.5k4[2 issues](https://github.com/blomstra/flarum-redis/issues)[1 PRs](https://github.com/blomstra/flarum-redis/pulls)MITPHP

Since Nov 4Pushed 3y ago3 watchersCompare

[ Source](https://github.com/blomstra/flarum-redis)[ Packagist](https://packagist.org/packages/bokt/flarum-redis)[ Docs](https://blomstra.net)[ RSS](/packages/bokt-flarum-redis/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (18)Used By (0)

Redis sessions, cache &amp; queues
==================================

[](#redis-sessions-cache--queues)

This library allows using Redis as cache, session and for the queue. You can only enable these services by using a local extender (the `extend.php` in the root of your Flarum installation). See the "Set up" section below.

> This is an advanced utility for webmasters!

### Installation

[](#installation)

Install manually with composer:

```
composer require blomstra/flarum-redis:*
```

### Set up

[](#set-up)

In your `extend.php`:

```
return [
    new Blomstra\Redis\Extend\Redis([
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1
    ])
];
```

This enables sessions, cache and queue to run on redis.

> See "Use different database for each service" below to split up the database for cache vs sessions, queue because a cache clear action will clear sessions and queue jobs as well if they share the same database.

#### Advanced configuration

[](#advanced-configuration)

1. Disable specific services:

```
return [
    (new Blomstra\Redis\Extend\Redis([
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
    ]))->disable(['cache', 'queue'])
];
```

2. Use different database for each service:

```
return [
    (new Blomstra\Redis\Extend\Redis([
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
    ]))
    ->useDatabaseWith('cache', 1)
    ->useDatabaseWith('queue', 2)
    ->useDatabaseWith('session', 3)
];
```

3. Completely separate the config array:

```
return [
    (new Blomstra\Redis\Extend\Redis([
        'connections' => [
            'cache' => [
              'host' => 'cache.int.yoursite.com',
              'password' => 'foo-bar',
              'port' => 6379,
              'database' => 1,
            ],
            'queue' => [
              'host' => 'queue.int.yoursite.com',
              'password' => 'foo-bar',
              'port' => 6379,
              'database' => 1,
            ],
            'session' => [
              'host' => 'session.int.yoursite.com',
              'password' => 'foo-bar',
              'port' => 6379,
              'database' => 1,
            ],
        ],
    ]))
];
```

4. Use a cluster:

```
return [
    (new Blomstra\Redis\Extend\Redis([
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
        'options' => [
          'replication' => 'sentinel',
          'service' => 'mymaster:26379',
        ]
    ]))
    ->useDatabaseWith('cache', 1)
    ->useDatabaseWith('queue', 2)
    ->useDatabaseWith('session', 3)
];
```

#### Queue

[](#queue)

Make sure to start your queue workers, see the [laravel documentation](https://laravel.com/docs/6.x/queues#running-the-queue-worker) for specifics. To test the worker can start use `php flarum queue:work`.

##### Queue options

[](#queue-options)

The queue allows for several options to be added, retry\_after, block\_for and after\_commit. You can set these by adding a `queue` array in the configuration:

```
return [
    (new Blomstra\Redis\Extend\Redis([
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
        'queue' => [
            'retry_after' => 120, // seconds
            'block_for' => 5, // seconds
            'after_commit' => true
        ]
    ]))
    ->useDatabaseWith('cache', 1)
    ->useDatabaseWith('queue', 2)
    ->useDatabaseWith('session', 3)
];
```

You can read up on the meaning of these options in the [Laravel Documentation](https://laravel.com/docs/8.x/queues#redis).

### Updating

[](#updating)

```
composer update blomstra/flarum-redis
```

### FAQ

[](#faq)

*Why are there still files in storage/cache?*Some code still relies on physical files being present. This includes the formatter cache and the view caches.

### Links

[](#links)

- [Packagist](https://packagist.org/packages/blomstra/flarum-redis)
- [GitHub](https://github.com/blomstra/flarum-redis)

---

- Blomstra provides managed Flarum hosting.
-
-

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.9% 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 ~70 days

Total

13

Last Release

1575d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/504687?v=4)[Daniël Klabbers](/maintainers/Luceos)[@luceos](https://github.com/luceos)

![](https://avatars.githubusercontent.com/u/16573496?v=4)[IanM](/maintainers/imorland)[@imorland](https://github.com/imorland)

---

Top Contributors

[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (26 commits)")[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (5 commits)")

---

Tags

rediscachequeuesessionflarumblomstra

### Embed Badge

![Health badge](/badges/bokt-flarum-redis/health.svg)

```
[![Health](https://phpackages.com/badges/bokt-flarum-redis/health.svg)](https://phpackages.com/packages/bokt-flarum-redis)
```

###  Alternatives

[yangusik/laravel-balanced-queue

Laravel queue management with load balancing between partitions (user groups)

8512.6k](/packages/yangusik-laravel-balanced-queue)[flarum-lang/russian

Russian language pack for Flarum.

12127.5k](/packages/flarum-lang-russian)[pdffiller/qless-php

PHP Bindings for qless

29113.7k1](/packages/pdffiller-qless-php)

PHPackages © 2026

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