if (false === ($cached = get_transient('City'.$_SERVER['REMOTE_ADDR']))) {
$city = $this->client->getCity();
set_transient('City'.$_SERVER['REMOTE_ADDR'], $city, 3600*24*200 );
setcookie("City", $City, time() + (3600*24*10), '/');
} else {
setcookie("City", $cached, time() + (3600*24*10), '/');
}
We’re using W3C Total Cache as a plugin and we’re caching stuffs to redis, but I am not sure if redis was installed on the server before W3C Total Cache, the question is how to set up WordPress so that the transients use redis cache instead of using the db. I am thinking of storing 1,000,000 key value pair, is it likely to cause any issue? I think I looked at the redis logs and I saw the maximum memory it used was 70 mb.
How do we set up WordPress to use redis cache for storing transients? What files do I need to change in order to do this? And will W3C Total Cache be a hindrance, because I don’t think it helps us set it up, and I am not sure if the configs will conflict with WordPress if I switch to redis cache for my transients.