I have query caching disabled (it's disabled by default on my installation) but kept getting outdated data in my application. For example, I would do a SELECT *
on my review
table, insert a new row and then do another SELECT *
, but the new review wouldn't show up (although it would be there if I browsed to the table in phpMyAdmin
). I disabled table caching (table_cache = 0
) and things started working fine, with all new reviews showing up on the second SELECT *
.
The MySQL documentation says that
The query cache does not return stale data. When tables are modified, any relevant entries in the query cache are flushed.
Is this not true for the table cache as well? Is there a way to have MySQL use table caching, but force it to flush the cache once a cached table is modified? I couldn't really find much to go by in the documentation .