javascript - Image doesnt refresh after PHP redirection (cache issue?) -


the problem next: @ main.php call php file, javascript script, synchronize user's image new 1 on server. after file functions finish (with no problem) , redirect header main.php, fast refresh made image not updated, keep watching old file if refresh page f5 new image shown.

cache problem? have tried html meta tags no luck. idea?

thanks lot.

edit: in order make clear. have tried headers , timestamp in redirection, no luck. here process:

  1. main.php, once user click on his/her image redirection javascript (location.href) update.php launched.
  2. i new image server, , save overwriting previous 1 (so name same)
  3. i add headers code, no chae headers... , location header redirecting again main.php , pass parameter via timestamp (time()).
  4. i reach main.php reload fast , new image not shown.

now think clearer.

thanks help.

yes cache issue, ie that. use append ?timestamp request avoid such scenarios.

edit:

yes got it. had same issue time ago. either way time stamp solution.

you have add time stamp <img src="path_to_image/image.jpg*?edited-time-stamp*" />

it worked me, hope works too.


Comments