diff --git a/index-wp-redis.php b/index-wp-redis.php index e20ece1cbc3f13d9bf434368b0b94eb22d716a35..792c2bdff502f072c9e7d0a3dfd1834ab082b294 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 224570ef0098f11591b220bf8c619ebeace3ef7e..efb37fa3505fbe18225f840bbe01c5a43c79da94 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 ); } } }