Normally, MySQL clears the cache automatically, when the tables are modified.
If there is any other query time limit which determine the lifetime, or generated cache could live for years, if the are no modifications ?
No, there is no TTL expiration policy for the MySQL query cache.
Of course all entries in the query cache go away when you restart the MySQL daemon.
And you can purge the query cache with RESET QUERY CACHE.
If you need greater control over caching, you should probably use Memcached or some similar dedicating caching technology that you access directly from your application code. In fact, more and more often I recommend to disable the MySQL query cache completely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With