Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image won't refresh

Status
Not open for further replies.

sunaj

Technical User
Feb 13, 2001
1,474
DK
Hi,

I can see that a lot of people have asked this before, but I can't find a proper answer.
I've got an ASP page using a dll to create an image. The user clicks a button and the page and image is updated.
The page is updated ok, but the browser does not not update the image because its called the same!!

How do I force the browser to download the image again instead of using the cached version ?

Response.Expires = -1 does not work.

Pls help
Sunaj
 
your only real alternative is to force the expiration of the cache.

paul brought this up in a previous thread, and there were some good suggestions brought up there.

see thread333-78530

hth
leo
 
You can try to call page with different name something like

<%
Function Random_nr
Randomize
RDM = CLng((999999999 * Rnd) + 1)
End Function
%>


then include this function in your page and on every link you can add page1.asp?nnn=random_nr

Page will be always treated like a new page because name is different and it will work ok (at least it works perfect for me :)

Oliver

P.S. If you use this function on more then one link it is good idea to create variable with value of function and then use this variable instead of calling function every time
 
Hi,

Yes thats close to the solution I've landed on.
It's not the page that's the problem but the images on the page, but the solution is the same.
I've made a running number (with a random number you could accidentailly get the same number even though it is extremely unlikely) and name my images with this number.
This leaves a lot of images on the server, and I clean up by putting the images in an empty directory and delete everything in the dir before new images are written.

Thanks for your interest.
Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top