I have a web search interface that can compare products in a table. This data set changes a few times a week.
I have been storing a "DISTINCT" list (used for parametric selection) in a cache
table. The query is computationally expensive because it involves table joins and thousands of records, hence the reason to cache it.
I was wondering if it is a good idea to "cache" certain data in PHP in dynamically generated code.
The idea is that I could create a cache.php file that is 'included' which has the data in arrays for PHP to use without going to the database. This PHP file could be cached using any of the PHP compiler caches out there.
I'm not having speed issues (yet), but I don't like the idea of having to ask the database for cache data, as it seems the overhead of the php->mysql transaction is expensive.