ASP.NET Image Caching Problem (How to Disable it?)

M

Mike Sobeiski

Hi There!

I'm developing a web project that requires to produce charts off the
database and output it as image and presented to the user in a HTML
document. (NOTE: Image is not directly streamed, but just linked in HTML
output).

The problem is, when user want to see the graph by changing parameters, they
always have to click refresh to see the updated graph image. Although this
problem doesn't occur on the local server.

So I'm just wondering, how to turn off the image caching in my ASP.NET
project so that users don't need to click Refresh every time they change a
parameter to see a different chart image?

Many thanks!

Mike
 
L

Lenard Gunda

I had a similar problem. But I think it's more a client side issue. Anyway
....

.... I solved it with a rather unusual way. Generate a unique ID string from
letters and/or numbers, and append it to the image as a HTTP GET parameter.
Like:

http://hostname/path/image.gif?uid=4235236

Make sure it changes all the time. A bunch of random numbers should do the
trick. And no more caching problems. (actually, I used it with an .aspx
page, that generate it's output everytime, but it doesn't matter). If it
really is a normal image, a parameter like in the example link above will
not disrupt the download.

-Lenard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top