Caching woes
Posted: Mon Jun 13, 2005 11:26 am
I'm having some severe caching problems... I've made an elaborate signature-switcher for forums that allows users to select your sig on-the-fly with a cool little selection interface. What it does is when the user selects a signature, it rewrites redir.php (which is where the signature's img tag points to) to say:
With SIGLOCATION of course being the url to the sig the user selected. The problem is that the browser caches the image at SIGLOCATION and assumes php is just some image extension (and so has no problem caching) so to actually see the change, the user has to clear his/her temporary internet files or switch browsers or just shift-refresh. To stop the caching, I'm adding anticache headers to redir.php... but to no avail:
The browser still caches the page! When I shift-refresh the forum page with the img tag (the signature) it works fine. But if I just refresh, it gets the image from cache instead of from redir.php. Is there anything I'm missing that I can do from the server-side (obviously my options are limited in the actual html of the forum page), like maybe in htaccess?
Code: Select all
header("e;Location: SIGLOCATION"e;)Code: Select all
header("e;Age: 2147483648"e;);
header("e;Expires: Mon, 31 Dec 2001 23:59:59 GMT"e;);
header("e;Pragma: no-cache"e;);
header("e;Cache-control: no-store, max-age=1"e;);