[Request] Redis object cache pro wordpress plugin

branljohns

Member
Jul 6, 2020
82
59
18
Hi my friend @miyojin
One more thing came up, see if you can help me:



1º - Do you know how to use this session correctly?
Code:
'database' => 0, // change for each site
I have several clients on a server with whm, cpanel.

I installed this on some wordpress sites, but this was happening:
When trying to access the PANEL - DASHBOARD of a SITE, I was directed to the other site.

The 2 sites using this plugin.



2º - Redis configuration server
Do I need to make any extra adjustments to speed this up?

I just increased the redis memory.



Thank you so much again.

The reason you're experiencing the redirection issue is that the site is using the Redis cache information to forward you to the primary site it is connected to (the first site). To bypass that you need to create a separate connect per website, so that Redis can differentiate.

To do that you'll want to update the WP-Config file for each of the sites you're running with the following:

define( 'WP_REDIS_PREFIX', 'example' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true);

Replace “example” with something unique for each site.
 

mrimpact

Member
Oct 4, 2019
44
35
18
The reason you're experiencing the redirection issue is that the site is using the Redis cache information to forward you to the primary site it is connected to (the first site). To bypass that you need to create a separate connect per website, so that Redis can differentiate.

To do that you'll want to update the WP-Config file for each of the sites you're running with the following:

define( 'WP_REDIS_PREFIX', 'example' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true);

Replace “example” with something unique for each site.

Thank you so much for that my friend.
 
  • Like
Reactions: branljohns

NoId

New member
Dec 3, 2019
12
5
3
so complete code for wp-config.php would be like below?

Code:
define('WP_REDIS_CONFIG', [
'token' => 'vYgPURcKzmz7M9TxUP4uYVG1l0mb1bu3JkaDTSQGzHezUWZfNyeGSmu0LK8E', // 60 chars random string
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0, // change for each site
'timeout' => 1,
'read_timeout' => 0.5,
'async_flush' => true,
'split_alloptions' => true,
'prefetch' => true,
'debug' => false,
'save_commands' => false,
]);

define('WP_REDIS_DISABLED', getenv('WP_REDIS_DISABLED') ?: false);
define( 'WP_REDIS_PREFIX', 'domain' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true);

Guys thanks for great plugin, you all are really awesome (y)
 

NoId

New member
Dec 3, 2019
12
5
3
invalid access token :(
should be 60 chars random string, working fine on my server, i just changed few characters in string and done, i think you are using same string that is posted here,
 
Last edited:

branljohns

Member
Jul 6, 2020
82
59
18
invalid access token :(

Honestly, the token isn't required. It's only necessary for access to updates. You can simply not supply it and the plugin will function perfectly well, but if you do add an access token it needs to be exactly 60 random alphanumeric characters. If it's less or more, the plugin won't work.
 

NoId

New member
Dec 3, 2019
12
5
3
@branljohns please can you help me for multisite setup?
'database' => 0, // change for each site
is it necessary to change database for every website? if yes then how to select a database?
in below code can i change 'example' with 'domain' ?
define( 'WP_REDIS_PREFIX', 'example' );
i copy config entries as mentioned in this thread, but when i check official log they are also recommending use
'maxttl'
should we use that also?

any help will be really appreciated
 

AlphaPrime

New member
Jul 21, 2019
20
5
3
"Your Redis Cache Pro license has expired, and the object cache will be disabled. Per the license agreement, you must uninstall the plugin."
on Multisite plugin page.
The plugin works, but this dosen t go away!
 

vijay1

Well-known member
Trusted Uploader
Apr 25, 2020
251
307
63
32
IN
"Your Redis Cache Pro license has expired, and the object cache will be disabled. Per the license agreement, you must uninstall the plugin."
on Multisite plugin page.
The plugin works, but this dosen t go away!
If the plugin works leave it there what's problem.
 

branljohns

Member
Jul 6, 2020
82
59
18
@branljohns please can you help me for multisite setup?
'database' => 0, // change for each site
is it necessary to change database for every website? if yes then how to select a database?
in below code can i change 'example' with 'domain' ?
define( 'WP_REDIS_PREFIX', 'example' );
i copy config entries as mentioned in this thread, but when i check official log they are also recommending use
'maxttl'
should we use that also?

any help will be really appreciated

No, it's not necessary to make any changes to the REDIS DB for multisite, as there's only one cache being created, there's nothing for it to compete with. So, adding the WP_REDIS_PREFIX constant is unnecessary.

MAXTTL is a definite. You should use it. It simply tells REDIS how often to invalidate its cache. This way you don't have to do so manually all the time. You should enter it in seconds. You can also use a formula to calculate it - i.e. 60*60*24*7 (that is 60 seconds x 60 minutes x 24 hours x 7 Days) is the same as 604800 (total number of seconds in the prior calculation).

There's really nothing else beyond what is already listed in this thread that absolutely needs to be added, but you should look at their documentation and see if anything else feels meaningful for your specific setup.

 

danielli

Member
Mar 29, 2020
200
21
18
No, it's not necessary to make any changes to the REDIS DB for multisite, as there's only one cache being created, there's nothing for it to compete with. So, adding the WP_REDIS_PREFIX constant is unnecessary.

MAXTTL is a definite. You should use it. It simply tells REDIS how often to invalidate its cache. This way you don't have to do so manually all the time. You should enter it in seconds. You can also use a formula to calculate it - i.e. 60*60*24*7 (that is 60 seconds x 60 minutes x 24 hours x 7 Days) is the same as 604800 (total number of seconds in the prior calculation).

There's really nothing else beyond what is already listed in this thread that absolutely needs to be added, but you should look at their documentation and see if anything else feels meaningful for your specific setup.



Hello,

Need help, and here is the info on my MULTISITE with subdirectory site, and here is what I used in wp-config by following their official suggestion at https://objectcache.pro/docs/installation/


/* Redis 配置 */
define('WP_REDIS_CONFIG', [
'token' => '79XegEAnob46AlUoMtM6FwCpmAAjCPhmlPzY52cFE6IYHYxsEdjFJ6QbJ98A',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0, // change for each site
'maxttl' => 86400 * 7,
'timeout' => 1.0,
'read_timeout' => 1.0,
'split_alloptions' => true,
'debug' => false,
]);

define('WP_REDIS_DISABLED', false);



/* That's all, stop editing! Happy publishing. */



here is the screenshot:

screnshot.png


As screenshot show:

The Redis Cache Pro license token is invalid and plugin updates have been disabled


  • Status: Not connected
  • Drop-in: Valid
  • License: Invalid


An object cache error has occurred:
  • Failed to initialize object cache: Redis Cache Pro requires the PHP extension PhpRedis 3.1.1 or newer. The extension is not loaded in this environment (fpm-fcgi). If it was installed, be sure to load the extension in your php.ini and to restart your PHP and web server processes.

By the way, we create the site by this tool at https://docs.wordops.net




It seems that I need update PHP extension PhpRedis 3.1.1 or newer?

but the Redis version is 5.3.2 now, and please check the screenshot:

redis.png



Any suggestion please?


Thanks in advance.
 
Last edited:

ckeeper

Well-known member
Nov 8, 2019
623
376
63
Hello,

Need help, and here is the info on my MULTISITE with subdirectory site, and here is what I used in wp-config by following their official suggestion at https://objectcache.pro/docs/installation/


/* Redis 配置 */
define('WP_REDIS_CONFIG', [
'token' => '79XegEAnob46AlUoMtM6FwCpmAAjCPhmlPzY52cFE6IYHYxsEdjFJ6QbJ98A',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0, // change for each site
'maxttl' => 86400 * 7,
'timeout' => 1.0,
'read_timeout' => 1.0,
'split_alloptions' => true,
'debug' => false,
]);

define('WP_REDIS_DISABLED', false);



/* That's all, stop editing! Happy publishing. */



here is the screenshot:

screnshot.png


As screenshot show:

The Redis Cache Pro license token is invalid and plugin updates have been disabled


  • Status: Not connected
  • Drop-in: Valid
  • License: Invalid


An object cache error has occurred:
  • Failed to initialize object cache: Redis Cache Pro requires the PHP extension PhpRedis 3.1.1 or newer. The extension is not loaded in this environment (fpm-fcgi). If it was installed, be sure to load the extension in your php.ini and to restart your PHP and web server processes.

By the way, we create the site by this tool at https://docs.wordops.net




It seems that I need update PHP extension PhpRedis 3.1.1 or newer?

but the Redis version is 5.3.2 now, and please check the screenshot:

redis.png



Any suggestion please?


Thanks in advance.
did you do this?
wo stack install --redis
 

danielli

Member
Mar 29, 2020
200
21
18
did you do this?
wo stack install --redis
yes, actually i always do this way: wo stack install --all, and create site by this way: wo site create mysite.com --wpredis --php74 --ls

by this way, wordpress site will run with redis cache, and it works well with nginx helper and Redis cache free version.

any suggestions please?
 

ckeeper

Well-known member
Nov 8, 2019
623
376
63
yes, actually i always do this way: wo stack install --all, and create site by this way: wo site create mysite.com --wpredis --php74 --ls

by this way, wordpress site will run with redis cache, and it works well with nginx helper and Redis cache free version.

any suggestions please?
We are talking about 2 different things here I would double check the reference documentation on wo stack install (I believe --all command is only applicable to wo stack upgrade --all )
--wpredis only installs the php end of the redis for wordpress.

You need to make sure the redis server is also installed in your instance.
try
systemctl status redis
see if it is already installed and running.
 

danielli

Member
Mar 29, 2020
200
21
18
We are talking about 2 different things here I would double check the reference documentation on wo stack install (I believe --all command is only applicable to wo stack upgrade --all )
--wpredis only installs the php end of the redis for wordpress.

You need to make sure the redis server is also installed in your instance.
try
systemctl status redis
see if it is already installed and running.

Hello,

Here is Redis cache server info:

root@aadsfZ:~# systemctl status redis
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-02-28 19:26:41 CST; 2 months 22 days ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 12934 (redis-server)
Tasks: 5 (limit: 9164)
Memory: 28.6M
CGroup: /system.slice/redis-server.service
└─12934 /usr/bin/redis-server 127.0.0.1:6379



root@aadsfZ:~# redis-server --version
Redis server v=6.0.6 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=d463d609620685c0
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu