Site icon Hip-Hop Website Design and Development

Utilizing redis as an alternative of MySQL for transients [closed]

    if (false === ($cached = get_transient('Metropolis'.$_SERVER['REMOTE_ADDR']))) {
      $metropolis = $this->client->getCity();
      set_transient('Metropolis'.$_SERVER['REMOTE_ADDR'], $metropolis, 3600*24*200 );
      setcookie("City", $Metropolis, time() + (3600*24*10), '/');
    } else {
      setcookie("City", $cached, time() + (3600*24*10), '/');
    }

We’re utilizing W3C Whole Cache as a plugin and we’re caching stuffs to redis, however I’m not certain if redis was put in on the server earlier than W3C Whole Cache, the query is the best way to arrange WordPress in order that the transients use redis cache as an alternative of utilizing the db. I’m pondering of storing 1,000,000 key worth pair, is it more likely to trigger any subject? I feel I regarded on the redis logs and I noticed the utmost reminiscence it used was 70 mb.

How can we arrange WordPress to make use of redis cache for storing transients? What recordsdata do I would like to alter in an effort to do that? And can W3C Whole Cache be a hindrance, as a result of I do not suppose it helps us set it up, and I’m not certain if the configs will battle with WordPress if I change to redis cache for my transients.