When enabling Redis cache two WP installs get confused with eachother

308 views
Skip to first unread message

David Farr

unread,
Apr 1, 2018, 8:11:20 AM4/1/18
to Redis DB
Hello,

I'm having an issue when Redis cache is enabled, two of the many WordPress installs I have happen to get confused with eachother.

For example, I go to login to site1.com and it ends up redirecting me to site2.com login page. Or sometimes it's still showing site1.com
in the address bar but it shows the styling of site2.com's login page.

My programmer and I have spent several hours trying to resolve the issue but the only thing that fixes it is disabling the Redis service via command
line.

We tried flushing the database and and flush all as well as restarting the Redis service but nothing seems to work. The two sites in
question are on the same VPS but different cPanel accounts. In fact, both sites in question are the primary domain of their respective cPanel accounts
and therefore happen to be installed in the root directory of each respective cPanel.

Any ideas for what to check?

Thank you!

David Farr

Marc Gravell

unread,
Apr 1, 2018, 8:47:47 AM4/1/18
to redi...@googlegroups.com
It sounds like the same cache keys are used on the same redis database by two sites. That will indeed cause confusion with collisions.

I don't know anything about your setup, but: at least one thing needs to change, presumably in your sites' configs; this could be:

- the redis database number (usually 0-19 are allowed by default, except on cluster where only 0 is valid)
- some key prefix
- the redis instance (port, server, etc)

Are any of those possible configuration options?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

David Farr

unread,
Jul 22, 2018, 8:02:36 PM7/22/18
to Redis DB
Thanks for your reply and sorry for the delay. I'm just now re-investigating this with my server admin. We did check and each site appears to be on database "0" when we look at the Redis WP plugin settings. Where would we look for the prefix?

Thanks for your help.

David Farr

Marc Gravell

unread,
Jul 23, 2018, 4:03:57 AM7/23/18
to redi...@googlegroups.com
A key prefix doesn't happen automatically - code would need to add it explicitly. Some libraries have that as an inbuilt feature (so: configure it once), some libraries don't. If there's nowhere in your code that mentions a prefix, you're probably not using one - so yes, if they're in the same db on the same server: they're going to get confused with eachother.

--
Reply all
Reply to author
Forward
0 new messages