I have images I regularly update on the same page via my PHP cms with the same filename. This causes a problem that the viewers that visit my page do not see the updated image unless they refresh their pages. How can I avoid this?
add; <img src="image.jpg?<?=rand(1,1000)?>"> If you want to do it right and have users use their client cache, you would do it like this; <img src="image.jpg?<?=$cur_image_refresh?>"> where $cur_image_refresh only changes when the CMS changes the pic.
instead of naming the file the same way it uploaded, give it a version number so that the filename is different. image_1.jpg As long as the user agents thinks it a different request itll refresh. Kwaku's way will also work just fine