I have a project that is a results database for several sport event series.
As you an imagine most the content remains more or less the same.
I would like to cache some of the content to save database queries.
The project is build using PHP and is using a custom MVC.
Where would you add the caching logic?
Use Memcached. Something like this, where you cache the results of the query, and try retrieving from cache before DB.
Edit: Added json_encoding the data… json_encode is slightly faster than PHP’s default serialization for arrays, and can be used by other applications accessing the data
Memcached by default uses FastLZ compression.
Edited to add comments in code