php - Setting cache timeout to a key in Codeigniter using predis package -


in codeigniter, i've installed predis package using composer. i'm able set , value cache using package. requirement need keep value in cache using redis 1 min. have seen different options setting through redis terminal. need set time limit in controller itself. idea ?

just use expire through predis:

$client = new predis\client(); $client->set('foo', 'bar'); $client->expire('foo', 60); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -