To everyone suggesting to use a cluster.. There's no need really. MySQL should scale well enough to millions of rows. You could use an incremental backup to guarantee data integrity in case of a node failure. Same applies to redis really, Redis can even store to disk in case of a reboot (or failure).

Please note selmanozturk I am working for my employer to migrate a phpBB forum to Flarum with over 100 million posts which already runs in complete sync. Complete load on the staging server is 4 seconds there. Once I have some of the last issues in order I will start doing some deeper performance investigation.

Kyrne there is no easy or fast way to ensure that the forum stays up when redis goes down. I believe building in a Redis down catch is treating a symptom instead of the underlying problem. Redis should be treated like your webserver, instead of making app based fallbacks when it goes down, just don't let it go down.

I do however digress and realize that a lot of people are running forums as hobbies. The latest version has catches to see if redis is down. Keep on mind though that your forum will be a lot slower while it's down.

Finally, the reason it will throw a 500 error if Redis is disabled first is because your users get thrown errors if you kill redis while they are using it (not realistically possible to make a catch for this) and it's there to let you know, "hey, do this in a different order." I'll add it to the docs.

Thanks but... Still not convinced 😃

Let's say that I use a managed Redis cloud service, provided by e.g. DigitalOcean/AWS. It's inevitable that at some point that service will go offline, for maintenance or other faults.

At that point, the forum will keep working but with a higher response time, right? So, if I wanted to avoid having this additional latency while Redis comes up, it is my understanding that if I disable the extension the forum breaks completely.

Is this accurate? Isn't this a plausible and relatively common use case that should be considered?

Thanks 🙂

    matteocontrini huh, I always considered these 2 events as separate, never thought about a collision. I'll change the disable behavior. You will need to clear your cache when it is re-enabled however.

      Kyrne clear your cache when it is re-enabled however

      Can't you use a Lifecycle hook on Enable?

      I disabled this extension to update it and not my site says An error occurred while trying to load this page.

      Anything I can do in the command line to recover this?

      Any way to re-enable through the command line?

      Quick question, it may sound strange.
      Is ReCache compatibility with WebSocket?

        Kyrne Thanks for the reply, sorry for being this annoying, just checking if I'm good to setup ReCache + Websockets & the following extensions? (any recommendations too?) also, i have enabled gzip too

        Fof Social Profile
        Flarum-Seo
        Flagrow Ads
        Fof User-Bio
        Fof Sitemap
        Fof Linguist
        Fof Best-Answer
        Fof Merge-Discussions
        Flagrow Flarum - Analytics
        Fof Links
        Fof Disposable-Emails
        Fof Terms
        Fof Disposable-Emails
        MathRen
        CORE – Approval
        CORE - bbcode
        CORE - emoji
        CORE - english
        CORE – fb login
        CORE - flags
        CORE - likes
        CORE - lock
        CORE - markdown
        CORE - mentions
        CORE - statistics (dashboard)
        CORE – sticky
        CORE – suspend
        CORE - tags

        `

          HuseyinKogo as of ReCache 2.0 almost every extension will work with ReCache. You are essentially free to install whatever you'd like to make your forum how you want.

            16 days later

            Hello Kyrne ,

            when i execute the install comman , it get me this result, has any solution?

            my flarum version:
            Flarum
            0.1.0-beta.12

            Could not find a matching version of package reflar/recache.

            Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (beta).

              5 days later

              Can i use this with redis extension's cache? Or I enable redis extension's queue feature is enough

                wloot Recache features a more powerful caching mechanism. I believe both should work just fine together, you may want to set a different database for each one however.

                  Kyrne Ok, I believe i got it. Btw I have an error that has never been reported, is it because of my misconfiguration?

                  ErrorException: Undefined offset: 1
                  #38 /vendor/reflar/recache/src/Replacers/Data.php(85): FoF\Sentry\SentryServiceProvider::handleError
                  #37 /vendor/reflar/recache/src/Replacers/Data.php(85): Reflar\ReCache\Replacers\Data::discussionPage
                  #36 /vendor/reflar/recache/src/Replacers/Data.php(57): Reflar\ReCache\Replacers\Data::replaceInCachedResponse
                  #35 /vendor/reflar/recache/src/Middlewares/CacheResponse.php(91): Reflar\ReCache\Middlewares\CacheResponse::process
                  #34 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #33 /vendor/fof/terms/src/Middlewares/RegisterMiddleware.php(54): FoF\Terms\Middlewares\RegisterMiddleware::process
                  #32 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #31 /vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(57): Flarum\Http\Middleware\ShareErrorsFromSession::process
                  #30 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #29 /vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Flarum\Http\Middleware\SetLocale::process
                  #28 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #27 /vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(37): Flarum\Http\Middleware\CheckCsrfToken::process
                  #26 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #25 /vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Flarum\Http\Middleware\AuthenticateWithSession::process
                  #24 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #23 /vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Flarum\Http\Middleware\RememberFromCookie::process
                  #22 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #21 /vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Flarum\Http\Middleware\StartSession::process
                  #20 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #19 /vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Flarum\Http\Middleware\CollectGarbage::process
                  #18 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #17 /vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Flarum\Http\Middleware\ParseJsonBody::process
                  #16 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #15 /vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Flarum\Http\Middleware\HandleErrors::process
                  #14 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #13 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\MiddlewarePipe::process
                  #12 /vendor/middlewares/request-handler/src/RequestHandler.php(84): Middlewares\RequestHandler::process
                  #11 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #10 /vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Middlewares\BasePathRouter::process
                  #9 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #8 /vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(42): Laminas\Stratigility\Middleware\OriginalMessages::process
                  #7 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #6 /vendor/middlewares/base-path/src/BasePath.php(53): Middlewares\BasePath::process
                  #5 /vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Next::handle
                  #4 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\MiddlewarePipe::process
                  #3 /vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe::handle
                  #2 /vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\HttpHandlerRunner\RequestHandlerRunner::run
                  #1 /vendor/flarum/core/src/Http/Server.php(42): Flarum\Http\Server::listen
                  #0 /public/index.php(26): null