$current_url=str_replace(array("?refresh=${secret_string}","&refresh=${secret_string}"),'',"http://${_SERVER['HTTP_HOST']}${_SERVER['REQUEST_URI']}");//clean up the URL
$current_url=getCleanUrl($secret_string);
$redis_key=md5($current_url);
$redis_key=md5($current_url);
try{
try{
// check if PECL Extension is available
// check if PECL Extension is available
if(class_exists('Redis')){
if(class_exists('Redis')){
$redis=newRedis();
$redis=newRedis();
// Sockets can be used as well. Documentation @ https://github.com/nicolasff/phpredis/#connection
// Sockets can be used as well. Documentation @ https://github.com/nicolasff/phpredis/#connection
$redis->connect('127.0.0.1');
$redis->connect($reddis_server);
}else// Fallback to predis5.2.php
}else{// Fallback to predis5.2.php
{
include_once("wp-content/plugins/wp-redis-cache/predis5.2.php");//we need this to use Redis inside of PHP
include_once("wp-content/plugins/wp-redis-cache/predis5.2.php");//we need this to use Redis inside of PHP
$redis=newPredis_Client();
$redis=newPredis_Client();
}
}
//Either manual refresh cache by adding ?refresh=secret_string after the URL or somebody posting a comment
//Either manual refresh cache by adding ?refresh=secret_string after the URL or somebody posting a comment