I have many data tables in my app (i.e. tables of data that could update at any moment, but most of the time they display the same data).

Some of these tables have fairly intensive queries behind them, so every time the user comes back to a page it runs the query again even if there are no new updates.

This is when I thought Memcached would be ideal to speed up performance for my users but I am unsure of how to implement this as I am quite new to the idea of caching.

How do I get MySQL to tell Memcached that results for a certain query have changed and that a table shouldn't come from cache next time it is loaded and instead come from the database and consequently update the cache?

Also, I think it would be better to have the data object for the table update only with new rows, but I have no idea what the process for this would be so if anyone has some ideas they can share for my use case it would be most appreciated.