Enable MYSQL Query Caching

Query caching can really help boost Magento’s performance where common queries are being called often, especially with Magento’s sprawling data structure.

Check to see if Query Caching is available:

mysql> show variables like ‘have_query_cache’;

If query_cache_size is 0 then it is effectively off. To turn it on, set the value in bytes:  (8MB is 1024*1024*8 = 8388608)

SET GLOBAL query_cache_size = 8388608;

It is also possible to set these values in the mysql config file:

query_cache_size = 268435456

These may already exist but be commented out.

Note that you can view all the of the query cache settings (handy for checking they are set) by running this:

mysql > show variables like ‘%query_cache%’;

If you have previously cached queries and you need to clear them then you can call:


However, you will need to be have reload privileges, which users should not have, so will probably require you to go in as admin.


Facebook Comments

Leave a Reply

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

Apply your human brain cells and complete this highly complicated maths problem *