The easiest way is to use MySQL's own query cache. Increasing its size yields wonderful results.<p>On linux, edit my.cnf and add the following:<p><pre><code> [mysqld]
...
query_cache_type=1
query_cache_limit=1M
query_cache_size=128M # or more - depends on you total available RAM
key_buffer=128M # or more
</code></pre>
Note that you'll need to restart mysql to make these changes count
The biggest thing you need to sort out when caching is exactly how well synced your cache needs to be.<p>Once you've written fresh data to the database, is it okay for you to keep receiving stale data in response to later queries?<p>If you've got multiple web servers, do they all have to return the same data, or is it okay if some lag behind the others?<p>If you're happy to serve stale (versus some tunable time metric) data inconsistently across different servers, then just find a database client library that does client-side result set caching (ADODB for PHP will do this, either in the filesystem or against memcache) and run with it.