php and mysql - avoiding cache -
i have problem 1 of users, make insert mysql database, when goes page list these inserts, return old data previous there. can see changes after several minutes or hours.
i read if add random number in url, can avoid cache, still not working.
i tried 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 tried 1 too:
select sql_no_cache... none work. still don't visible changes.
try using expires headers in htaccess file. need ask user ctrl+f5 (force refresh) correctly take effect;
<ifmodule mod_expires.c> expiresactive on expiresbytype text/html "access plus 0 seconds" </ifmodule> this tell browser not cache text , html within directory , subdirectories (unless otherwise specified). had similiar issue , resolved when realised caching affecting update of live data.
Comments
Post a Comment