Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
So if I want to change default lifetime, should I add
$config['pageCache']['lifetime'] (default: 600);
or
$config['pageCache']['lifetime'] = 600;
?

nevermind. found it out by a test. )
it's $config['pageCache']['lifetime'] = 600;
 
Last edited:
For which cache page level guest cache ? for that Cloudflare. Just use Redis for non-page Xenforo caching combined with Cloudflare :)
For CSS what is the best?

Or maybe you could give more advanced answer like
for CSS - better this solution.
for guest page - this solution etc.
 
I found this in docs:
$config['pageCache']['routeMatches'] (default: []) - an array of route prefixes where the cache is active. For example, ['threads/', 'forums/'] would only cache thread- and forum-related pages.

Can I configure redis to cache pages for 600 ($config['pageCache']['lifetime'] = 600;)
plus in addition to configure a route prefix 'tags/' and set lifetime for those to 86400?
Or I'm a dreamer? )
 
Can I set up "page for guest cache" on CF with pro plan? Or only with business?
full page cache for guests can be done on Cloudflare with either Business plan or Cloudflare Workers if you code Workers to do full page guest cache with cache bypass on cookie. I use Cloudflare Business and Enterprise plans with bypass cache on cookie full guest HTML page cache and also Cloudflare Worker based bypass cache on cookie full guest HTML page cache and works well for Wordpress and Xenforo and also combined with Xon's Redis cache addon for Xenforo and Redis object cache for Wordpress :D
For CSS what is the best?
clarify non-full page cache use Cloudflare CDN cache for static images on top too. Xon's Redis cache is mainly to reduce amount of hits to backend database server.

Gist of it use Cloudflare cache + Xon's Redis addon together (without native Xenforo page cache)
 
Last edited:
Redis 3.2 is rather old. It is likely the stats either don't exist in that version or have a different name.

You can also try refreshing a few times and see if it is just a lack of site activity
 
Redis 3.2 is rather old. It is likely the stats either don't exist in that version or have a different name.

You can also try refreshing a few times and see if it is just a lack of site activity
the old version is from the distribution, it's in the epel repository ( https://centos.pkgs.org/7/epel-x86_64/12/ ) and maintained by red hat.

[root@ ~]# rpm -q redis --changelog|more
* Fri Oct 26 2018 Nathan Scott - 3.2.12-2
 
@Xon I know that you do not provide support for Redis server, but maybe you can help me or some one other.

I did this from your FAQ

Run:
echo never > /sys/kernel/mm/transparent_hugepage/enabled

Add to /etc/rc.local

echo never > /sys/kernel/mm/transparent_hugepage/enabled

but each time after server rebooted I have notification in redis logs that
WARNING you have Transparent Huge Pages (THP) support enabled in your kernel

I have ubuntu 20 with OpenLiteSpeed
 
I've been using a one-shot systemd service;

Filename: /etc/systemd/system/disable-transparent-huge-pages.service
Contents:
Code:
[Unit]
Description=Disable Transparent Huge Pages
DefaultDependencies=no
After=sysinit.target local-fs.target
Before=basic.target

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c '/bin/echo never > /sys/kernel/mm/transparent_hugepage/enabled'
ExecStart=/bin/sh -c '/bin/echo never > /sys/kernel/mm/transparent_hugepage/defrag'

[Install]
WantedBy=basic.target

This should then run before the redis service.
 
This is replacement for ?
Add to /etc/rc.local

echo never > /sys/kernel/mm/transparent_hugepage/enabled

or additional step?

Since I dont have this warning if I have both. If i remove
echo never > /sys/kernel/mm/transparent_hugepage/enabled
from
etc/rc.local
but have etc/systemd/system/disable-transparent-huge-pages.service

I have warning again.
 
That service replaces the previous recommendation

You need to enable it after creating the file with;
Code:
systemctl daemon-reload
systemctl enable disable-transparent-huge-pages
systemctl start disable-transparent-huge-pages
systemctl restart redis-server
 
Could you explain what do you mean in settings for

Caches per forum thread counts to reduce forum view page times.

Since english is not my first language, I cant right understand what this meaning.
This is reduce loading time for page and will speed up loading of page?
or
This will reduce the number of times in counter the page are viewed?
 
Hi all,

I'm using this configuration:

Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
        'server' => '10.1.1.10',
        'port' => 6379,
        'connect_retries' => 2,
        'use_lua' => true,
        'compress_data' => 1,
        'read_timeout' => 1,
        'timeout' => 1,
        'password' => '***********',
        'database' => '2',
        'persistent' => true,
    );

I have a very busy board, more than 12M posts and 40K unique visitors per day.
Some questions:

compress_data => 1 ...has anyone tested the compression? What would you recommend?
persistent => true ...my thoughts are that it's better to have persistent connections on such a busy forum.

Thanks!
 
When I activate the development mode, I get the following error.

Code:
Fatal error: Uncaught TypeError: Failed to create closure from callable: class 'SV\RedisCache\Redis' does not have a method 'redisQueryForStatDebug' in /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php:159 Stack trace: #0 /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php(159): Closure::fromCallable(Array) #1 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/CacheFactory.php(66): SV\RedisCache\Redis->__construct(Array) #2 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('SV\\RedisCache\\R...', Array) #3 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/App.php(687): XF\CacheFactory->create('SV\\RedisCache\\R...', Array) #4 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/Container.php(228): XF\App->XF\{closure}('', Array, Object(XF\Container)) #5 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/App.php(2491): XF\Container->create('cache', '') #6 /home/admin/domains/f in /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php on line 159

Fatal error: Uncaught TypeError: Failed to create closure from callable: class 'SV\RedisCache\Redis' does not have a method 'redisQueryForStatDebug' in /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php:159 Stack trace: #0 /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php(159): Closure::fromCallable(Array) #1 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/CacheFactory.php(66): SV\RedisCache\Redis->__construct(Array) #2 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('SV\\RedisCache\\R...', Array) #3 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/App.php(687): XF\CacheFactory->create('SV\\RedisCache\\R...', Array) #4 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/Container.php(228): XF\App->XF\{closure}('', Array, Object(XF\Container)) #5 /home/admin/domains/forum.xxxxxx.com/public_html/src/XF/App.php(2491): XF\Container->create('cache', '') #6 /home/admin/domains/f in /home/admin/domains/forum.xxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php on line 159
 
Top Bottom