title: When does Laravel clear the cache?
body: <p>I am trying to utilize <code>Redis</code> with Laravel 5 to cache queries/results to make my application run faster.</p>
  
  <p>However, I have couple of questions which should help me decide when it is a good time to use <code>Cache</code> and when it is not.</p>
  
  <p>Assume I have the following</p>
  
  <pre><code>$interview= Cache::remember('SomeUniqueKey', 180, function(){
  
      return SurveyInterview::where('user_id', 123)
                            -&gt;with([
                                      'current_step.page',
                                      'pages'
                                  ])
                            -&gt;first();
  });
  </code></pre>
  
  <p>The previous code should cache the collection set returned by eloquent. which is a total of 3 queries. First to query the model, second to query the <code>current_step.page</code> relation and the last one to query the <code>pages</code> relation.</p>
  
  <p>It is my understanding that as long as I execute the above code over and over, Laravel will return the collection from the cache until the 180 minutes are up from the time the collection was cached.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Will laravel automatically remove the cache if an update took place to my database tables? In other works, will it remove the cache once I make an update to my <code>SurveyInterview</code> model or will I have to remove that manually every time I update the model?</p>