Automattic / wp-memcached

Memcached Object Cache for WordPress.
https://wordpress.org/plugins/memcached/
GNU General Public License v2.0
159 stars 55 forks source link

Bug with transient API #155

Closed mbautista closed 11 months ago

mbautista commented 12 months ago

Hello, We used wp memcached successfully on a customer website, but recently we had to disable it because a specific plugin did not work correctly, more info here (french) : https://wordpress.org/support/topic/le-paiement-oney-ne-fonctionne-plus/

The specific plugin relies on transients and apparently when we enable object caching transients are not reliable anymore.

The plugin author recommended us to switch to WP Rocket (sic) in which there is an option not to cleanup transients in database, which apparently fixes the problem.

Does anybody knows if there is such a possibility for wp memcached ? Or maybe we could add some filters to exclude this plugin from object cache ?

Thank you for your help :) Mathieu.

dd32 commented 11 months ago

Hi @mbautista,

Transients are designed to store "transient data" which may exist, or may not. Plugins should not use them for data that they expect to 100% persist between requests, the data may "vanish" at any time.

Caches such as Memcache are designed that any data stored within them may be deleted at any time, as it prioritises commonly accessed stored data points. This object cache dropin for WordPress has no ability to control that.

Instead, plugin authors who are using the WordPress transients API and expecting the data to 100% exist should switch to using Options or other storage methods that are more appropriate to their use-case.

mbautista commented 11 months ago

Hello, Thank you for your answer. I will see with the author plugin. Thank you for your help :) Mathieu.