Using this directive, we specify which type of query cache we are setting.There are 3 possible options that can be set for this directive. 1) The zero “0” 2) The one “1” 3) The two “2” These are the values that can be set for this directive. The zero “0” The zero tells the server the following: Don’t cache the results in or retrieve results from the query cache.Naturally My SQL will invalidate cache entries for any given table if that table is modified.It is also very worth mentioning that My SQL uses byte by byte comparison of SQL statements for the cache.For My SQL, there is a general query cache which can help tremendously.The My SQL is one of the important feature in My SQL and an inevitable part of query optimization.After the caching, results will be set in a memory cache like memcached or cassandra.
The above commands mean that the maximum size of individual query results that can be cached set to 1048576 using query_cache_limit system variable. This is how we can set the query caching in the My SQL.By using the query caching, the response from this My SQL servers can be optimized. In this article, we are going to see how to enable the query caching in an My SQL server.In order to enable the query caching, we need to add the following configuration directives.As we know, caching is used to improve performance.It will increase loading speed of the website or application.