title: Direct MySQL Query or Cached File - which is faster?
body: <p>I'm trying to determine if getting results directly from the mysql database, under a heavy load, is faster or slower than getting results from a cached file.  Which will be the fastest in any situation.</p>
  
  <p>I have two sets of data which I'm using a cached file on.  I'm using PDO.</p>
  
  <ol>
  <li>One displays a list of categories which returns - category letter, category name, and category number results. I'm pulling 400 categories per page.</li>
  <li>Video thumbnails which returns - title, url, views, source, and duration.  I'm pulling about 140 thumbs w/ data per page.</li>
  </ol>
  
  <p>I have the cache file set up to serialize the array results and save then to a file.  If the cached file time is still valid it will display the results from the cached file versus from the database.</p>
  
  <p>I'm trying to determine if querying the database is better than accessing the cache file to display the results.  Tests I've done seem to indicate that getting the results from the file is faster than the database.  But, I'm not a guru by any stretch... so I wanted to see if anyone can help me with some feedback. </p>
  
  <p>Thanks!</p>