I heard that a lot of big project administrators caches results. I wonder how do I do it? Thanks
I'm using PHP.
I heard that a lot of big project administrators caches results. I wonder how do I do it? Thanks
I'm using PHP.
Pseudo-logic:
Test if query result exists in cache
If so,
retrieve from cache
return result
else
execute query against database
transfer results to an array, list or object(s) [dependent on language]
store results in cache (serialize if necessary)
return result
Often memcache or APC (if you're using PHP) can be used to store the cache, but files can be used at a pinch. Code will vary depending on what medium you're using for cacheing