You are here

public function MockMemCacheDrupal::stampedeProtected in Memcache API and Integration 7

Determines whether stampede protection is enabled for a given bin/cid.

Memcache stampede protection is primarily designed to benefit the following caching pattern: a miss on a cache_get for a specific cid is immediately followed by a cache_set for that cid. In cases where this pattern is not followed, stampede protection can be disabled to avoid long hanging locks. For example, a cache miss in Drupal core's module_implements() won't execute a cache_set until drupal_page_footer() calls module_implements_write_cache() which can occur much later in page generation.

Parameters

string $cid: The cache id of the data to retrieve.

Return value

bool Returns TRUE if stampede protection is enabled for that particular cache bin/cid, otherwise FALSE.

Overrides MemCacheDrupal::stampedeProtected

File

tests/memcache.test, line 767
Test cases for the memcache cache backend.

Class

MockMemCacheDrupal
Wraps the MemCacheDrupal class in order to be able to call a protected method.

Code

public function stampedeProtected($cid) {
  return parent::stampedeProtected($cid);
}