title: Frequent updates on cached data laravel
body: <p>I'm currently caching posts using laravel's built in caching with redis. however i'm running into a problem when caching posts. i basically have a column called score in the posts table that gets updated whenever user upvotes/downvotes and the problem is that if a user upvotes or downvotes a cached post the score column doesn't update until 10 minutes pass (that's how many minutes until the cache changes using laravel's built in Cache::remember function. What's the best way to solve this? Here is a code example of what i mean</p>
  
  <pre><code>public function home(Request $request)
      {
          //Get posts that have high scores and in the last 7 days..
  //       $posts = Post::with('user')-&gt;orderBy('score','desc')-&gt;whereRaw('created_at &gt;= now() - INTERVAL 7 DAY')-&gt;paginate(30);
         $page = $request-&gt;has('page') ? $request-&gt;query('page') : 1;
         //$posts = Post::with('user')-&gt;orderBy('score','desc')-&gt;paginate(50); 
        $posts = Cache::remember('posts' . $page, 10, function(){
        return Post::with('user')-&gt;orderBy('score','desc')-&gt;paginate(1);
  });
         return view('posts.home', compact('posts','page'));
      }
  </code></pre>
  
  <p>Everything works perfectly and the posts are cached the problem appears when the user upvotes/downvotes. the score column doesn't update </p>