Query Cache v1.6 released
8New version of Query Cache is available. If You have lots of categories in Your store, this release is a must. Download new version here. Version 1.6 adds following features:
- Option to prefetch products_to_categories table for faster execution of zen_get_categories_products_list() function. You can turn ON/OFF this functionality by changing QC_ZEN_GET_CATEGORIES_PRODUCTS_LIST_PREFETCH switch in includes/extra_configures/query_cache.php. If Your store executes thousands of queries it’s pretty good chance that this option will solve it.
- Query Cache can now work in Admin area too. Just enable QC_ENABLE_IN_ADMIN in admin/includes//extra_configures/query_cache.php.
By default new switches are set to false. If You have many (at least few hundreds) products linked to many categories prefetching products_to_categories table will probably improve performance. On one store this switch managed to reduce query count from 15 000 queries ( yes, 15 thousands queries!) to about 100 queries (99,3% less queries!).
If You’ll find any bugs, please report back.

How do I limit the size of the cache dir, it seems to be getting massive
Query Cache does not use file based caching and does not store anything in cache/ folder. I’m not quite sure but I think it’s impossible to limit Zen Carts own cache. There are other cache solutions for Zen Cart – do You use any of them?
Is there a way to ‘turn off’ Query Cache easily instead of deleting and re-installing files. Want to compare differences in performance with and w/o Query Cache.
No, unfortunately there isn’t any switch. If You want to turn off query cache edit includes/auto_loaders/config.query_cache.php and comment the line:
‘className’=>’QueryCache’,
‘objectName’=>’queryCache’,
‘checkInstantiated’=>true);
Make also sure to turn off all switches in includes/extra_configuration/query_cache.php
I am wondering if anybody else is having problem with their site when QC_ZEN_GET_CATEGORIES_PRODUCTS_LIST_PREFETCH is set to TRUE. It doesn’t work for us when we have category level greater than 2.
I checked QC 1.6 and it works on multi level categories. I can’t tell for sure but I think it’s because QueryCache tries to prefetch part of products_to_categories table and it does not fit in server memory. If You have test site with copy of the store and You can give temporary access to it to me I can check what is the problem and develop patch specific to Your site.
Any plan to upgrade this for Zen Cart 1.3.9b since the two core files touched by this more are updated in 1.3.9b.
Great software ! I edited two core files of zencart v1.3.9b with your added code for zencart v.1.3.8 and they work just fine !