Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread TImage and browser cache
Tue, Mar 7 2017 11:00 AMPermanent Link

thomh

Hi,

Is there a way to tell the browser not to cache the file/image that is returned and loaded when setting the TImage.URL property?

I return an image file from my server using a single filename but the content is always a different image.

It is only the first time I set the TImage.URL property that it goes to the server to read the file. Consecutive URL property assignments gets the image from the browser cache.

Thanks.

// Thom
Tue, Mar 7 2017 11:13 AMPermanent Link

Uli Becker

Thom,

> It is only the first time I set the TImage.URL property that it goes to the server to read the file. Consecutive URL property assignments gets the image from the browser cache.

I can't help you with the question how to avoid the cache, but that's
what I do:

   Image1.URL := 'MyImage.jpg' + '?' + FloatToStr(Random);

With the param the image is different for the browser and is loaded
correctly.

Uli
Tue, Mar 7 2017 11:28 AMPermanent Link

thomh

Excellent, Uli!

That fooled the browser cache.

Thank you.

// Thom
Image