• Resolved Alnaggar

    (@alnaggar)


    Hello, I’m new to using Redis, Can I host multiple WordPress sites (60+) and use object caching (for the database) with Redis without problems?
    I’m using Plesk with Litespeed EN.

    as I read I can achieve that in 2 ways either by using different “Redis Database ID” Or different cache key salt parameters on wp-config.php like this:

    define(‘WP_CACHE_KEY_SALT’, ‘sitewp1.com’);
    define(‘WP_CACHE_KEY_SALT’, ‘sitewp2.com’);
    define(‘WP_CACHE_KEY_SALT’, ‘sitewp3.com’);

    *Note: Also each site uses a different table prefix.

    The question is does the LSCache plugin use the parameter “WP_CACHE_KEY_SALT” or a different parameter? as the “WP_CACHE_KEY_SALT” used by the “Redis Object Cache” plugin, After I enabled the object cache from sitting with Redis it works fine but it didn’t add the “WP_CACHE_KEY_SALT” to the wp-config.php or should I do that manually?

    What’s the right way to use Redis object cache with LSCache with multiple WordPress sites? I don’t prefer using database ID for each site and I don’t mind that all of the websites will use the same Redis database, I liked the way of using different cache key salt parameters and want to know the right way to do it with LSCache.

    The last thing is there are a few keys in the wp-cofing.php but none of them “WP_CACHE_KEY_SALT” :

    
    /**
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    
    • This topic was modified 3 years, 2 months ago by Yui. Reason: wp-config.php SALTS removed
    • This topic was modified 3 years, 2 months ago by Yui. Reason: formatting
Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Yui

    (@fierevere)

    永子

    Authentication Unique Keys and Salts.

    those salts in wp-config.php are used as seeds for cookie and nonce generation
    (and are considered to be private data not to be exposed to public, i have removed them from your post)

    WP_CACHE_KEY_SALT this constant is not used within plugin code,
    and as i can quickly check, there are no site based salts used for redis or memcached cache.
    However, plugin support team can give a better compherensive answer to this question and they can add this to their TODO list for plugin.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    our plugin will add a random prefix to each site , e.g.

    37a93post_meta.2583

    and

    9c63cpost_meta.48

    the first 5 string is randomly prefix

    but I must pointed out , such action may result a security threat if you don’t separate the Redis , one site could have access to all the data stored in Redis , that is not a good thing

    Best regards,

    Thread Starter Alnaggar

    (@alnaggar)

    @qtwrk – Thank you so much for your helpful replay, I understand that it’s dangerous from the security side but my use case is different from normal, I will be using it in a Waas system and the clients will not have any type of access to the database or ssh, etc… they will only manage their WordPress dashboard it’s kind of fully managed WordPress.

    How I can check the prefix of each site? I can’t find it in the wp-config.php

    Plugin Support qtwrk

    (@qtwrk)

    Thread Starter Alnaggar

    (@alnaggar)

    Thanks for your patience with my questions I really appreciate that.

    I’m not a developer I just want to know when this random prefix happens? Does it happen the first time I install the plugin?

    What if I clone a site that has the LSCache plugin preconfigured to a new domain will the prefix be the same?

    Or do I have to clone the site first without the LSCache plugin then install it on the new domain so it can generate a different prefix?

    Plugin Support qtwrk

    (@qtwrk)

    well , I am not developer either

    here is a quick explanation to the above code

    it will create a prefix by using 5 first string out of a m5sum value of file path , and in combine this blog_id if it’s WP network

    and it’s virtually impossible to have 2 different WP sites on exact same file path on same server , and only case for that is network , which will attached with blog_id to differentiate them

    so as long as you don’t spread your sites across different servers and use same file path for all of them , and they are all connect to same Redis server, then you will be fine , no need any additional things to do

    just make sure they are not in same file path

    Thread Starter Alnaggar

    (@alnaggar)

    Thank you so much, Now I get it I really appreciate your explanation.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multiple WordPress sites on single Redis server’ is closed to new replies.