Two explanations to get you started:
MySQL query cache is a server function, there is no such thing as a "local cache". You are probably confused by the LOCAL keyword in the FLUSH . Since docs explains this simply an alias for NO_WRITE_TO_BINLOG (thus, it is associated with replication, and “local” means “this server”).
MySQL will only return cached data if you enable this function and either do it by default or select it using the SQL_CACHE hint. In my experience, most servers do not have it by default.
Now let's answer your question. In the MySQL cache, you can read:
The request cache is distributed between sessions, so a result set created by one client can be sent in response to the same request issued by another client.
Which makes sense: a cache that cannot reuse stored data is not that useful.
I do not know what you want to check for sure. Your data should always be fresh:
The query cache does not return stale data. When the tables are changed, any corresponding entries in the query cache are cleared.
However, you can get an idea of how long the request will take. You can always opt out of the SQL_NO_CACHE :
The server does not use the request cache. It does not check the cache request to make sure that the result is already cached, and it does not cache the result of the request.
Just keep in mind that a query that is executed a second time can run faster even without a cache, as part of the data segments may already be loaded into RAM.
source share