Join the community today
Become a Member

Xenforo xenforo redis installation

Discussion in 'Forum software usage' started by xenbiarritz, Aug 7, 2020.

Tags:
  1. xenbiarritz

    xenbiarritz Member

    44
    3
    8
    May 7, 2017
    Ratings:
    +4
    Local Time:
    7:13 PM
    hi
    i follow your guide here to install redis + xon addon
    Xenforo - Xenforo 2.1.0 Beta 1 Install & 2.1.0 Final Upgrade On Centmin Mod 123.09beta01 LEMP Stack

    i used your script
    Code:
    cd /svr-setup
    wget -O redis-install.sh https://github.com/centminmod/centminmod-redis/raw/master/redis-install.sh
    chmod +x redis-install.sh
    ./redis-install.sh install
    redis-cli --version
    Code:
    redis-cli 6.0.6
    
    then i copy/past
    add to Xenforo 2.1.0 src/config.php
    Code:
    $config['cookie']['prefix'] = 'xfa_';
    
    // https://xenforo.com/xf2-docs/manual/cache/
    // global cache
    $config['cache']['enabled'] = true;
    $config['cache']['namespace'] = 'xfaredis_';
    $config['cache']['provider'] = 'Redis';
    $config['cache']['config'] = [
        'host' => '127.0.0.1',
        'port' => 6379,
        'serializer' => 'igbinary',
    //  'password' => 'password',
    //  'timeout' => 0.0,
        'database' => 3,
    //  'persistent' => true,
    //  'persistent_id' => 'global'
    ];
    
    // session cache
    $config['cache']['sessions'] = true;
    
    // guest page cache
    $config['pageCache']['enabled'] = true;
    $config['pageCache']['lifetime'] = 900;
    $config['pageCache']['recordSessionActivity'] = true;
    $config['cache']['context']['page']['namespace'] = 'xfaredispagecache_';
    $config['cache']['context']['page']['provider'] = 'Redis';
    $config['cache']['context']['page']['config'] = [
        'host' => '127.0.0.1',
        'port' => 6379,
        'serializer' => 'igbinary',
        'database' => 5,
    //  'timeout' => 1,
    //  'persistent' => true
    ];
    
    // css cache
    // $config['css']['enabled'] = true;
    $config['cache']['context']['css']['provider'] = 'Redis';
    $config['cache']['context']['css']['namespace'] = 'xfarediscsscache_';
    $config['cache']['context']['css']['config'] = [
        'host' => '127.0.0.1',
        'port' => 6379,
        'serializer' => 'igbinary',
        'database' => 7,
    //  'timeout' => 1,
    //  'persistent' => true
    ];
    but it does not work
    if i use this
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['provider'] = 'SV\RedisCache\Redis';
    $config['cache']['config']  = array(
            'server' => '127.0.0.1',
            'port' => 6379,
            'compress_data' => 6,
        );
    it workes but i really want to use your code
    what can i do?

    thank you for your help
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Don't use my code as Xenforo 2.1 native full page html cache is broken for some in that log out users get 304 status and see logged in user page mistakenly Guest page caching
     
  3. rdan

    rdan Well-Known Member

    5,008
    1,208
    113
    May 25, 2014
    Ratings:
    +1,834
    Local Time:
    2:13 AM
    Mainline
    10.2
    I think that only happens when using CF.
     
  4. xenbiarritz

    xenbiarritz Member

    44
    3
    8
    May 7, 2017
    Ratings:
    +4
    Local Time:
    7:13 PM
    Cf?
     
  5. R0rke

    R0rke Member

    163
    20
    18
    Jun 2, 2016
    Iran
    Ratings:
    +34
    Local Time:
    10:13 AM
    1.11.1
    10.1
    Cloudflare
     
  6. R0rke

    R0rke Member

    163
    20
    18
    Jun 2, 2016
    Iran
    Ratings:
    +34
    Local Time:
    10:13 AM
    1.11.1
    10.1
    is this happening on 2.2?
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    It happens with or without Cloudflare and can happen with Cloudflare CDN full HTML page caching too but only tested on Xenforo 2.1. Have yet to setup test Xenforo 2.2 instance to do my Xenforo 2.2 page speed optimisations/testing. Though there's a few work around I've done for my paying clients with Cloudflare CDN full HTML page caching. The gist is don't use Xenforo's native full HTML page caching. There's better alternatives.
     
  8. R0rke

    R0rke Member

    163
    20
    18
    Jun 2, 2016
    Iran
    Ratings:
    +34
    Local Time:
    10:13 AM
    1.11.1
    10.1
    can you provide some alternatives, please
    I'm sorry but my English isn't well enough some times I can't understand so well so I apologize
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I usually work with my paid clients for the best solutions for their needs. Xenforo you can do full page HTML guest caching by other means too.

    I generally just use Cloudflare CDN cache in full page HTML guest caching via CF Worker custom caching with bypass cache on cookie or CF Business plan's bypass cache on cookie.

    You can try PHP-FPM fastcgi_cache though only tried on XF 1.5 myself (on this forum + combined with Cloudflare Worker caching via bypass cache on cookie). Xenforo 2.2 has @rdan guide at XenForo 2.x + Nginx fastcgi_cache full page guest caching.

    Example of my custom Cloudflare Worker guest full HTML page caching for this forums with per URL specific cache TTL values depending on importance of thread and frequency of thread updates will either have cache TTL of 600 seconds during peak hour or 1200 seconds for off peak and 432,000 seconds for infrequently updated threads i.e. closed threads which are important

    cache TTL = 600 for WebPerf - Chrome web.dev Live 2020 On Youtube

    opera-network-full-html-page-cache-headers-02.png opera-network-full-html-page-cache-timings-02.png

    cache TTL = 432,000 with custom HTTP/2 server pushed assets on select number of important threads only i.e. WebPerf - Cloudflare - Cloudflare Wordpress Plugin Automatic Platform Optimization

    opera-network-full-html-page-cache-headers-01.png opera-network-full-html-page-cache-timings-01.png

    Though Cloudflare Workers involve billable costs at US$5/month for first 10 million requests and then US$5 per 10 million requests. So my 90 million requests/month = 5 + (8x5) = US$45/month extra. A billion requests/month would be 5 + (99.5x5) = US$502.50/month

    While you can do similar Cloudflare guest full HTML caching on Cloudflare Business plan at US$200/month via page rule bypass cache on cookie without the Cloudflare Worker costs.
     
    Last edited: Oct 22, 2020
  10. Jon Snow

    Jon Snow Active Member

    589
    88
    28
    Jun 30, 2017
    Ratings:
    +141
    Local Time:
    2:13 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    How many people reported this? Because when I log out, things work fine for me. I don't use CF tho.
     
  11. rdan

    rdan Well-Known Member

    5,008
    1,208
    113
    May 25, 2014
    Ratings:
    +1,834
    Local Time:
    2:13 AM
    Mainline
    10.2
    I don't have that issue either, not using CF.
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah it's a strange issue, I've come across it myself with and without Cloudflare though.