title: Caching Feeds from Facebook, Twitter & Instagram
body: <p>I'm building a site for a non-profit festival where we'd like to have a 'media' page which brings in photos from instagram (hashtag search), updates and photos from Facebook (via festival's albums) twitter posts (by user and hashtag).</p>
  
  <p>I've tried the JS widgets for Facebook and Twitter but wondered about using PHP/Codeigniter to pull the feeds and caching them somehow for better performance and more control over the look.</p>
  
  <p>Would it be best to then store the feed data in a json file on the server or in a MySQL record? </p>
  
  <p>I'm leaning toward a table with a record for each feed that would basically just store the feed URL, JSON, last updated time and an identifier of some sort.</p>
  
  <p>Then I could write a class with the following type of methods:</p>
  
  <pre><code>get_feed($id='facebook_updates', $expiry_time=3600);
  </code></pre>
  
  <ol>
  <li><p>Does this seem like a reasonable way to go? or is there a better solution already existing?</p></li>
  <li><p>I'm not quite sure how I'd work that in with the feeds that need Auth (twitter &amp; Instagram)</p></li>
  </ol>