How to check MySQL cache lifetime?

Normally, MySQL automatically flushes the cache when tables change.

If there is any other request time interval that determines the lifetime, or can the generated cache survive for years if there are no changes?

+7
source share
1 answer

No, there is no TTL expiration policy for the MySQL query cache.

Of course, all entries in the query cache disappear when you restart the MySQL daemon.

And you can clear the RESET QUERY CACHE query cache.

If you need more control over caching, you should probably use Memcached or some similar initiation caching technology that you access directly from your application code. In fact, more and more often I recommend completely disabling the MySQL query cache.

+5
source

All Articles