codeigniter-redis
codeigniter-redis copied to clipboard
How can i set time for expire.
Hello,
How can i set particular cache for particular time. ?
I have tried using this : $this->redis->set('foo2', 'bar',500); but its not working. please some one look in to this.
Thanks, Hardik Devariya
You'll want to check the Redis commands list on redis.io to see what's wrong, here.
The short answer is that set doesn't support including an expiration. You'll need to use setex instead.
Hello i have checked it using https://redis.io/commands/setex and it works fine on the redis cli.
but how can i use using php codeigniter code i have tried this : $this->redis->setex('foo2', 'bar',500);
but it still not work from ci.
If you look again at the command docs, you'll see that order matters, here.