Query Cache for Zen Cart released

2

Update: Query Cache V1.6 has been released – read here

Query Cache is free, in memory cache designed to work with Zen Cart. It can reduce number of queries sent to database by over 80% (see charts below). Thus, Query Cache  might greatly reduce query execution time and response time of most Zen Cart stores.

You might want to jump quickly to see Demo Stores. Compare number of queries on each store.

Performance Analysis

We’ve ran some tests on demo installment of Zen Cart 1.3.8a which contains just a few products, few categories, one customer and no orders. Still, Zen Cart generated over nine hundred queries (>900!) just to load first page of the demo store (You can check how many queries generates Your store by turning on ‘Display Page Parse Time’, read more). After that, Query Cache has been installed and it managed to reduce number of queries by half (from 900 to 199 queries approx.).

Other pages where also checked, including: category view page, search results page and ‘static’ (more or less) shipping information page. Results are presented on figures below:

Advantages of Query Cache

  • reduces number of queries sent to database by 80%
  • it’s very easy to install (jump to Installation instructions)
  • reduces page generation time, reduces load on database server.
  • works with all 1.3.x versions of Zen Cart

Disadvantages of Query Cache

As far as We can tell there is only one disadvantage: at this moment Query Cache can’t detect if database has been changed while php script is running. This means that if, for example, information about product is pulled from database, then product is updated, and retrieved again from database (all happening in one request) updated information might not be retrieved (in next request information will be updated).

Download

Here is package including Query Cache for ALL versions of Zen Cart 1.3.x:

Download Query Cache – latest version

Installation Instructions

First, download contribution here. Extract it with WinZip or something similar. Go to extracted directory. There are few directories named like ‘Zen-Cart 1.3.x’ where ‘x’ is minor version number of Zen Cart. To install this module:

  1. BACKUP BACKUP BACKUP!
  2. Upload ‘includes’ directory (from directory corresponding to Your Zen Cart version) on Your server (via ftp, sftp or any other protocol).
  3. Done.

Note: Query Cache v1.5 has feature that might slow down Your store if Your web server is very slow. In such case You can try to set QC_USE_PRODUCT_QUERY_DETECTION in includes/extra_configures/query_cache.php to FALSE.
This contribution is preconfigured to use Query Log _IF_ it’s available. If Query Log is not installed, Query Cache will still work without any problems (or at least it should;)

How to verify that Query Cache Works

Before installing Query Cache check how many queries Your store executes:

  • Enable ‘Display The Page Parse Time’ option in Store Admin in Configuration -> Logging.
  • Go to Your store, scroll down and see how many queries where executed.

Now, install Query Cache and visit the same page. Check query count, it should be much lower.

Screencast

Here is screencast showing how to install this contribution.

Demo Stores

Here are two Demo Stores:

Demo Store with Query Cache installed

Demo Store without Query Cache installed

Take a look at footer of each store. As You can see Query Cache greatly reduced number of executed queries.

Is it free? (Yes)

Yes, it is. You can use it on unlimited number of sites without any costs. You can redistribute it, change the source code (but leave us as original authors) etc. You can’t sell it or make any profit of it.

Stay in touch

We plan to release new version of Query Cache soon, with some new features that will further reduce number of executed queries and improve performance of Your store. Just type Your address here to be notified of new versions of Query Cache (You’ll receive only updates on Query Cache). Quick info: We hate spam, Your email will not be given to anyone.

This article has 2 comments

  1. Christopher Corsaut 12/03/2009, 01:20:

    Thanks so much for developing this! I look forward to hearing about your progress with new versions, so please let me know.

    I am reading that Zen Cart 1.4 is being developed, and it will make things considerably faster – any news you have on that would be awesome to know!

    All the best, full of gratitude,

    Christopher

Trackbacks/Pings

Leave a Reply

Your email address will not be published. Required fields are marked *

*




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free

Social Stuff

Donate

If You like Query Cache, Query Log or Randomized Tests please make a $5 donation.

Search the blog