Closed Cyrille37 closed 2 months ago
Hello. Is my comment wrong or confirmed ? Thanks & cheers
This has salt based on the ABSPATH
of the site so WP_APCU_KEY_SALT
is needed only if more than one WordPress site is using the same directory on the server.
Yeah! Thanks, that's nice :-) But the README has to be updated, isn't it ? Best Regards.
So should we define something like define( 'WP_APCU_KEY_SALT', 'somethinghere' );, right?
And does it support WooCommerce?
where do I have to define the WP_APCU_KEY_SALT ? in object-cache.php or in a plugin? if i define it in a plugin, it would only be available once the plugin is loaded IOW plugins and other functions loaded before this plugin would not have the the constant.
where do I have to define the WP_APCU_KEY_SALT ? in object-cache.php or in a plugin? if i define it in a plugin, it would only be available once the plugin is loaded IOW plugins and other functions loaded before this plugin would not have the the constant.
You would put it in your wp-config.php
file.
makes sense.
WP_APCU_KEY_SALT is not required to be set anywhere. If you don't understand what it is for then you likely don't need it
I see, in my case ABSPATH differs for multiple WP installation on the same machine, so WP_APCU_KEY_SALT is not required?
Correct. It is only need in very rare edge cases when someone is running multiple WP sites from a single set of core WP files. I don't know of anyone that does this so the default WP_APCU_KEY_SALT is fine.
thank you.
sorry for asking again.
I have a machine with multiple WP installations. Each install is in it's own directory, so ABSPATH differ. But in object-cache.php WP_APCU_KEY_SALT is defined with "wp", not ABSPATH, so all installations are using the same salt, no?
Code says:
` if (!defined('WP_APCU_KEY_SALT')) { /**
https://github.com/l3rady/object-cache-apcu/blob/main/object-cache.php#L1120
Key uniqueness is made from an md5 of abs path. As long as your ABSPATH differ between installs on the same machine the keys wont clash. WP_APCU_KEY_SALT only needs to be changed if all installations share the same physical set of WP files.
THANK YOU!
Hello, Thank you for this extension that makes wordpress greener (and faster) !
I think the docu on WP_APCU_KEY_SALT is wrong because we need to define WP_APCU_KEY_SALT not only when sharing a wp-config.php but when we share a Php instance (mutualized php). Like with php-fpm, the APC memory is shared with all pools so we have to define a unique WP_APCU_KEY_SALT for each wordpress installation.
So the documentation may be : If you have more than one Wordpress installation which share the same Php you have to define a unique WP_APCU_KEY_SALT for each.
Thanks again and cheers :-) Cyrille37.