Created
May 16, 2013 13:10
-
-
Save aaronschachter/5591594 to your computer and use it in GitHub Desktop.
flush_page_cache addition in settings.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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