title: Set data in redis cache in yii2
body: <p>I have configured redis in my yii2 project. Now, i am performing a query like this(query is working)-</p>
  
  <pre><code>$dist = Model::find()-&gt;where(['IN','col1',$arr])-&gt;all();
  </code></pre>
  
  <p>I've used some functions to set the data in cache but can't figure out whether it's set or not?</p>
  
  <p>After setting or storing data in cache, i will need to access it. How can i store data and later access it when needed.</p>
  
  <p>Any help will be appreciated. Thanks.</p>