tollmanz / wordpress-pecl-memcached-object-cache

A WordPress object cache that uses the memcached (not memcache) PECL extension.
233 stars 114 forks source link

Respect `wp_suspend_cache_addition()` #34

Closed tollmanz closed 10 years ago

tollmanz commented 10 years ago

As indicated in a recent trac ticket, most of the 3rd party object caches do not respect core's wp_suspend_cache_addition() function. As the name suggests, if this function is called, new values should not be added to the cache. The core WP_Object_Cache respects this method (but oddly, only for add, not for set).

At a minimum, this object cache needs to respect the suspension for adds. It will prevent against the unfortunate widget "leakage" issues.

tollmanz commented 10 years ago

This is good to go; however, tests are no longer passing for WP 3.7.1 and 3.6.1 in PHP 5.5. This is due to the WP 3.9 version of the tests being executed and causing PHP warnings for the db_connect() function. I am not sure if it is best to try to alter the tests, try to load the 3.6x and 3.7x versions of the tests, or exclude these versions altogether.