I plan to use memcached for caching and our pages use data from about 6-10 lookup tables per page. Which is a better option for better performance?
1. Cache data from lookup tables individually with a differend id.
2. Cache data from all lookup tables for the page under one id.
The first option would result in several caches (one for each table without redundancy) but these little caches could be used across multiple pages. Whereas the second one results in fewer caches with mostly redundant data in each cache. The thing that is not clear to me is getting multiple caches to stuff into a page might consume more time compared to getting just one cache (with all the lookup data) for the page. If this is not clear, here is an example:
Instead of generating 3 caches for the page with 3 get()s, it could be just one cache of large array of 3 tables with just one get().
Please clarify which would have a better performance.