Cache requests and database queries.


Compatible with Flarum v1.3.0

Latest release 3.0.1

10 subscribers


released on Jul 18, 2019



ReCache enables caching of requests and database queries, image optimization, and image lazy loading. Greatly reducing the overall loading time for pages on your forum.

This is a premium extension. Installation and updating requires an active subscription of $5 per month.

Gains and Data:

All data was taken from an Ubuntu server running 18.04.

The first image is of a guest who has never loaded the website, and is an Uncached response (no browser cache and no ReCache) - response time: 1308ms

The second image is of a guest who has never loaded the site and is only cached via ReCache (No browser) - response time: 634

For guests, you are looking at around a 52% reduction in loading times.

For users however, the speed up is more dramatic as they're utilizing the browser cache as well - only 103 ms!!

That's an incredible 93% page load time reduction.

With query caching we saw a 50% reduction in load times for discussions, posts, and user search (once cached) and a significant decrease in load on the database as time progressed.

Smart caching:

ReCache listens to all database queries which means it knows when discussions are added, posts are updated, or when a new user registers. The cache will intelligently update its store so your forum is always up to date, and nothing is missed.

Integrations and Security

  • ReCache is permission aware, Byobu and posts in restricted tags will continue to stay private, while still benefiting from the cache.
  • ReCache supports all 3rd-party extensions that make use of the database in Flarum.
  • ReCache supports fof/upload for image optimization.


Use extiverse/bazaar or check the FAQs on on how to use a custom token, then run:

$ composer require reflar/recache --prefer-dist -o

Go into your admin area then the extensions panel, and enable it.


This extension requires a bit more configuration than most extensions, but don't worry, this guide will walk you through every step. If you ever find you self stuck, or just want someone to guide you, please don't hesitate to join our Discord.

If you plan to use...

Redis for caching:
  1. Install redis-server on your Linux machine (Windows users can download a copy of Redis here.)

    • Ubuntu/Debian: $ sudo apt-get install redis-server
    • CentOS: $ sudo yum install redis then $ sudo systemctl enable redis
  2. Optional: Add a password or change the config of Redis please see this guide.

  3. Go into your Flarum admin panel, then to ReCache settings and change the driver to "Redis" and input your Redis connection values.

    • With no changes to a locally installed Redis put as the host, leave password blank, set the port to 6379 and set the database to 1.
  4. Before saving your settings please click the "Check" button. If it returns anything but a success alert, do not save your settings, check your configuration and try again.

    • If you accidentally saved your settings and now your Flarum won't load, please see the "troubleshooting" section.
  5. Once checked, click "Save Settings"

Query Caching:

  1. Query caching is a Redis only feature, please see above for setting up Redis

  2. Ensure your web server (usually www-data) has write access to FlarumBaseDirectory/vendor/flarum/core/src/Database, this command will do it for you $ chown www-data -R FlarumBaseDirectory/vendor/flarum/core/src/Database

    • Note: FlarumBaseDirectory is the root directory of your Flarum install.
    • If your web server does not have write permission and you try to save your settings it will throw an error.
  3. Once Redis is setup you will see a switch labeled "Enable Query Cache (Redis Only)." Click the switch then click "Save Settings."

Image optimization:

(Note: this is not officially supported on Windows)

  1. You will need to install 3 Linux packages jpegoptim, optipng, and pngquant. These can be installed on Ubuntu/Debain and CentOS using apt-get or yum install respectively.

  2. Go into your Flarum admin panel, then to ReCache settings and click the "Enable image optimization" switch then click "Save Settings"

Lazy image load:

No special setup required, just click the switch in the admin panel then save your settings.

After updating or installing new extensions:

Inside your Flarum root directory run $ php flarum recache:clear.

This will clear the ReCache and allow the new extensions to add their code to Flarum.


If you are using Redis and now your forum won't load:

Inside your Flarum root directory run $ php flarum recache:recover.

This will disable Redis as your driver and allow Flarum to load. You will need to re-enable Redis as the caching driver inside or ReCache's settings in the admin panel after running this command.

If you experience any weirdness on your forum (especially after installing new extensions) or are having other issues:

Inside your Flarum root directory run $ php flarum recache:clear.

This will clear the ReCache and force it to grab entirely new data.

If you are still unable to solve your issue.

Please see the support links at the below.


© 2022 Hyn by DaniĆ«l "Luceos" Klabbers. All rights reserved. · Extensions and extension information is provided by the respective (copyright holding) authors. · Extiverse is not affiliated to the Flarum project or Flarum foundation. · Images on Extiverse pages are from Unsplash.