From 7e5a41c094559829d83467fd7145a59c850c12f2 Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Wed, 26 Feb 2014 11:16:09 -0800 Subject: [PATCH] Placeholder for future cache variants --- index-wp-redis.php | 14 ++++++++++++++ wp-redis-cache/wp-redis-cache.php | 2 ++ 2 files changed, 16 insertions(+) diff --git a/index-wp-redis.php b/index-wp-redis.php index e20ece1..792c2bd 100644 --- a/index-wp-redis.php +++ b/index-wp-redis.php @@ -36,6 +36,13 @@ $GLOBALS['wp_redis_cache_config']['redis_key'] = md5( $GLOBALS['wp_redis_cache // Start the timer so we can track the page load time $start = microtime(); +/** + * MOBILE HANDLING + */ +if ( wp_redis_cache_is_mobile_request() ) { + $GLOBALS['wp_redis_cache_config']['redis_key'] = 'MO-' . $GLOBALS['wp_redis_cache_config']['redis_key']; +} + /** * UTILITY FUNCTIONS */ @@ -106,6 +113,13 @@ function wp_redis_cache_get_clean_url( $secret ) { return str_replace( $replace_keys, '', $url ); } +/** + * + */ +function wp_redis_cache_is_mobile_request() { + return false; +} + /** * Establish a connection to the Redis server * diff --git a/wp-redis-cache/wp-redis-cache.php b/wp-redis-cache/wp-redis-cache.php index 224570e..efb37fa 100644 --- a/wp-redis-cache/wp-redis-cache.php +++ b/wp-redis-cache/wp-redis-cache.php @@ -245,11 +245,13 @@ class WP_Redis_Cache { $redis_key = md5( $permalink ); $redis->del( $redis_key ); + $redis->del( 'MO-' . $redis_key ); //refresh the front page $front_page = get_home_url( '/' ); $redis_key = md5( $front_page ); $redis->del( $redis_key ); + $redis->del( 'MO-' . $redis_key ); } } } -- GitLab