The scenario is simple: I have created the ability to upload an avatar image. However when I upload different images I still see the previous image. I am using the same file name however it's predicable and creates less server load. So I'm only interested in preventing the image from being loaded in the cache only on the following condition: $_FILES['image_avatar']['name'] != "". I would not mind in example trying to use a random generated path that the server would still point to the same image though since the browser would see a different path it would then not bother with the cached version.
I did try this though without any luck...
Code: Select all
header('Expires: Tue, 22 May 1988 03:20:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, n0-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');