[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

How to disable caching pictures?

vidguy

5/19/2005 4:19:00 PM

Hello there,

I am developing an ASP.NET application (v1.1.4322) and I need to find a
solution for the following:

1. One of the pages in the application displays information about items,
which is read from a FireBird Database and displayed in DataGrid control.
2. Each item can have a picture associated with it and it has to be
displayed along with the other info too.
3. I decided to always save the picture to one and the same file (for
instance "temp.jpg") and return a link to it in the resulting response. (let
me say this method is good enough for the situation)
4. Here is where the problem comes - once the first picture is loaded the
browser never reloads it from the server when you navigate to other items
until a new session is opened (or F5 pressed of course). It remains cached
in the Temporary Internet Files folder until doing so.

I can organize some kind of a unique name generation for the current
session, but do I have to?
I would appreciate any kind of help.


2 Answers

Joerg Jooss

5/19/2005 8:02:00 PM

0

Gen wrote:

> Hello there,
>
> I am developing an ASP.NET application (v1.1.4322) and I need to find
> a solution for the following:
>
> 1. One of the pages in the application displays information about
> items, which is read from a FireBird Database and displayed in
> DataGrid control. 2. Each item can have a picture associated with it
> and it has to be displayed along with the other info too.
> 3. I decided to always save the picture to one and the same file (for
> instance "temp.jpg") and return a link to it in the resulting
> response. (let me say this method is good enough for the situation)
> 4. Here is where the problem comes - once the first picture is loaded
> the browser never reloads it from the server when you navigate to
> other items until a new session is opened (or F5 pressed of course).
> It remains cached in the Temporary Internet Files folder until doing
> so.
>
> I can organize some kind of a unique name generation for the current
> session, but do I have to?
> I would appreciate any kind of help.

Configure IIS to mark your images non-cacheable:

1. Create your image file in a separate subdirectory (e.g. "images").
2. Set a custom header for this directory: Cache-Control: no-cache
using IIS'' admin applet.

Cheers,
--
http://www.joe...
mailto:news-reply@joergjooss.de

vidguy

5/20/2005 12:52:00 PM

0

Thank you very much - configuring the images folder from IIS to mark them as
non-cacheable solved the problem.