title: Laravel 3: Cache behaviour on multiple/simultaneous reads/writes
body: <p>Using Laravel's <strong>3</strong> Cache (<strong>file</strong>):</p>
  
  <p>It is safe to read/write/update Cache containing payments data and expect to always have the latest up-to-date data when multiple users are simultaneously modifying the Cache?</p>
  
  <p>In a web app I am building, the payments information is saved across multiple MySQL tables.
  In order to minimize the number of queries for reading the data, everything is read from Cache (file) until a new payment is made, then the Cache is cleaned/updated.</p>
  
  <p>In some situations, lots of payments can be made simultaneously, I want to know if the Cache will be always up-to-date in cases like this.</p>
  
  <p><strong>In a really simplified way this is what is happening when getting payments:</strong></p>
  
  <pre><code>    if (Cache::has($cache_key))
      {
          $payments = Cache::get($cache_key);
      }
      else
      {
          $payments = [ get payments code here ];
          Cache::put($cache_key, $payments, 60);
      } 
  
      return $payments;
  </code></pre>
  
  <p><strong>And then when a new payment is made:</strong></p>
  
  <pre><code>    Cache::forget($cache_key);
  </code></pre>
  
  <p>Thanks.</p>