|
|
 |
Re: FN-FORUM Caching image problem...grrrrrrr
date posted 1st September 2000 08:54
>I have been developing a PHP script to enable members of a site to upload
>images via a web page. The script deletes the old photo and uploads the new
>one but the image file is all ways called the same name ie..username.jpg
>This all works fine, however the problem is, when they have done this a page
>appears showing them the pic they have just uploaded...now if they change
>their picture again the old image appears on this confirmation page...until
>you refresh it that is..then the correct image is shown. So I was wondering,
>is there a way of stopping the Browser caching this image?
Marc,
The way I ususally get round this problem is this:-
Don't worry about the browser cacheing the page. Force the browser to
request the page from the server again by adding a querystring to the end
of the URL which is slightly different each time.
This fools the server into thinking that the browser has requested a
completely new page and therefore the confirmation page is pulled from
the server instead of from the cache
Try something like this:
|
 |
|