Forum Moderators: coopster

Message Too Old, No Replies

Preventing image cache

         

neophyte

3:07 am on Jun 11, 2008 (gmt 0)

10+ Year Member



Hello All -

I'm using php's image library to create thumbnail images for a certain project involving a personnel list. This works fine, except for when a person on the list is deleted. Here's the scenario:

if a person from this list is being deleted, the admin is first shown a WARNING page with the person's original (color) thumbnail image with a "Are you sure you want to delete this person?" kind of message. if the admin clicks the delete button a second page is presented with a black and white thumbnail of the person being deleted - visually indicating that the person has been deleted.

Unfortunatly, what shows up on this second page is the same color image (which has been dynamically replaced before the page loads with the same image in grayscale). Now, If I manually refresh the second page, the grayscale images DO show up.

So, I'm thinking that the original color images (which have already been over-written by the grayscale images) are still caught in the cache.

If this sounds like a likely scenario, is there a way to prevent this from happening?

Neophyte

omoutop

8:03 am on Jun 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



if it is a cashe problem, i think you need to use clearstatcache(). This may help

eelixduppy

1:26 am on Jun 12, 2008 (gmt 0)



You can force no cacheing on that page by changing the headers. Something like the following would work:

header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");