php和mysql - 避免缓存

I have a problem that one of my users, make an insert into my mysql database, but when he goes to another page to list these inserts, it only return old data that was previous there. He can only see the changes after several minutes or even hours.

I read that If I add a random number in my url, I can avoid cache, but still not working.

I tried to put these headers on php.

header("Cache-Control: private, no-store, no-cache, must-revalidate"); 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

And I tried this one too:

SELECT SQL_NO_CACHE...

None work. Still don't get any visible changes.

Try using the Expires headers in your htaccess file. You will need to ask your user to Ctrl+F5 (Force refresh) for it to correctly take effect;

<IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType text/html "access plus 0 seconds"
</IfModule>

This will tell the browser not to cache the text and html within that directory and any subdirectories (unless otherwise specified). I had a similiar issue and resolved it with this when I realised my caching was affecting the update of live data.