Skip to content

Instantly share code, notes, and snippets.

@aaronschachter
Created May 16, 2013 13:10
Show Gist options
  • Save aaronschachter/5591594 to your computer and use it in GitHub Desktop.
Save aaronschachter/5591594 to your computer and use it in GitHub Desktop.
flush_page_cache addition in settings.php
// Wrapper class for extending MemCacheDrupal to support flushing a page's cache.
require_once DRUPAL_ROOT . '/includes/cache.inc';
require_once DRUPAL_ROOT . '/sites/all/modules/memcache/memcache.inc';
class FlushPageCacheMemCacheDrupal extends MemCacheDrupal {
function get($cid) {
// Handle flush page cache request by deleting the cached object and returning FALSE.
if (function_exists('flush_page_cache_requested') && flush_page_cache_requested()) {
return FALSE;
}
return parent::get($cid);
}
}
$conf['cache_default_class'] = 'FlushPageCacheMemCacheDrupal';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment