Magento2 MySQL Query Cache – Enjoy the performance!

Updated 30 December 2020

Magento’s performance enhancement is a priority for the vast majority of Magento developers. To ultimately acquire, expand, maintain, and retain customers for potential growth and development in businesses. In addition, they make some strides to speed up the Magento store to serve the purpose. Magento2 MySQL Query Cache – This is an additional way to accelerate the store.

Magento2 MySQL Query Cache

The MySQL Query Cache is a memory that is stored within the MySQL daemon to store a request result. The result is available immediately whenever a similar request is executed by someone. Instead of calling a new request, we can get the same result from the cache.

Working Mechanism

When a user requests a query, then the MySQL query cache searches the result in the cache memory and if it exists, returns the result from the cache. If there is no result available, then the query is logged. After the query execution, the result is stored in the cache for future use for similar requests.

Implementation

Let’s turn to the execution section, where we learn to Configure or enable the MySQL Query Cache.

  1. Firstly, log in to the MySQL command prompt and run the below command :

As we seen, the value is always YES for the MySQL standard binary irrespective of the cache state of the query. 

2. After the above step, find out whether the query cache is operational or not by following the listed command:

The image above shows that we have sufficient memory for query cache size means it is enabled. And the below image indicates the disabled state because it depicts the ‘0’ as a query cache size.

3. If you have root access then make the changes to this value by mention these lines in /etc/mysql/my.cnf file and restart the mysql server to enable it.

4. It is prudent to remember a few other parameters too when setting up Magento2 MySQL server.

If you want to optimize your Magento2 store by Leverage Browser Caching just click.

Do you need optimization for your Magento2 store? Check us out.

Thanks for reading!

We hope it works for you and during this blog you have found something valuable.

In case of any help or query, please contact us or raise a ticket.

Category(s) magento
author
. . .

Leave a Comment

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


Be the first to comment.

Start a Project






    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home