I have a script that creates a thumbnail of an image (using GD) that the user uploads via the browser.
But I'm having troubles because of Cache, the thumbnail is showing the old image after uploading a new one.
I've tried to disable cache like this:
header("Expires: Mon, 26 Jul 1981 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
and by using metatags in header:
<HEAD>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="Tue, Nov 21 2000 05:00:00 GMT">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
And I've put thesed meta's at the end after the </BODY> tag.
Does anyone know what I'm doing wrong??
Please help...
Thanks!!!! 🙂