When you use your code to insert the data and you do not see the data when you navigate to another part of your site, do you actually see the data when access your database from the command-line?
If yes, then this has nothing to do with the query cache at all. In fact, MySQL query cache is only used for select queries. Either you have inserted your data or it was not inserted at all.
If no, then there is a problem with the way you are inserting the data into your database.