Skip to content

For multiple single-site installs on single server, should WP_CACHE_KEY_SALT default to db_name + table_prefix? #61

@jeffwidman

Description

@jeffwidman

I have multiple single-site installs on a single server. All use the same memcache server.

I want to make sure each site uses distinct keys to avoid collisions.

From the code, it looks like I have to manually specify a unique WP_CACHE_KEY_SALT in each site's wp-config.php to guarantee each site has unique namespacing of keys.

Might it be better to make WP_CACHE_KEY_SALT default to db_name + table_prefix? This should prevent collisions if I forget to define WP_CACHE_KEY_SALT. Some single-site installs on a single server will use the same database with different table prefixes, some will use different databases with the same table prefix, but a combination of the two should guarantee uniqueness. Inspired by here.

I also looked into using site_id + blog_id, but because they're single-site installs and thus unaware of each other, it doesn't look like this works. Alternatively, perhaps there's a variable for the domain name/subfolder that could be used instead?

I can submit a PR if desired, just wasn't sure if this was the best way to handle the issue... I'm rather new to Wordpress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions