[lnkForumImage]
TotalShareware - Download Free Software

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


 

maluco.beleza

2/1/2006 4:25:00 PM

Hi,

I'm new to asp .net and am having a few problems with web controls.

I have a page which displays an image. On that page, I also allow users
to upload a new image. Once I upload the new image, I set the ImageUrl
to the newly loaded image and the new image is displayed. However, if I
leave the page and come back to it, the old image shows up. I can only
see the new image if I refresh my browser.

I'm guessing that the page is being cached and all I need to do is to
avoid that of happening. I've read a few posts on caching but I'm still
shaky on the subject.

Does anyone have an idea of how I can solve this problem? Any help will
be greatly appreciated.

Thanks,
Ma

2 Answers

Joerg Jooss

2/1/2006 7:00:00 PM

0

Hello maluco.beleza@gmail.com,

> Hi,
>
> I'm new to asp .net and am having a few problems with web controls.
>
> I have a page which displays an image. On that page, I also allow
> users to upload a new image. Once I upload the new image, I set the
> ImageUrl to the newly loaded image and the new image is displayed.
> However, if I leave the page and come back to it, the old image shows
> up. I can only see the new image if I refresh my browser.
>
> I'm guessing that the page is being cached and all I need to do is to
> avoid that of happening. I've read a few posts on caching but I'm
> still shaky on the subject.
>
> Does anyone have an idea of how I can solve this problem? Any help
> will be greatly appreciated.

You have to mark all these image files as non-cacheable. In your case it's
best to put all these files in a separate folder and apply the following
options to the folder, not individual files.

1. Run the IIS admin applet
2. Navigate to the image folder (or file) in the tree view
3. Open the folder's (or file's) context menu and select Properties
4. Here, you can set an expiration date. You can also choose to set any other
HTTP header, such as CacheControl: no-cache.

In your case, you can either try immediate expiration or set CacheControl:
no-cache.

Cheers,
--
Joerg Jooss
news-reply@joergjooss.de


maluco.beleza

2/2/2006 3:57:00 AM

0


Hi Joerg,

Thank you very much for your help.
I followed your instructions on setting the properties on IIS and all
images on my pages are up to date now.

Thanks again,
Ma






Joerg Jooss wrote:
> Hello maluco.beleza@gmail.com,
>
> > Hi,
> >
> > I'm new to asp .net and am having a few problems with web controls.
> >
> > I have a page which displays an image. On that page, I also allow
> > users to upload a new image. Once I upload the new image, I set the
> > ImageUrl to the newly loaded image and the new image is displayed.
> > However, if I leave the page and come back to it, the old image shows
> > up. I can only see the new image if I refresh my browser.
> >
> > I'm guessing that the page is being cached and all I need to do is to
> > avoid that of happening. I've read a few posts on caching but I'm
> > still shaky on the subject.
> >
> > Does anyone have an idea of how I can solve this problem? Any help
> > will be greatly appreciated.
>
> You have to mark all these image files as non-cacheable. In your case it's
> best to put all these files in a separate folder and apply the following
> options to the folder, not individual files.
>
> 1. Run the IIS admin applet
> 2. Navigate to the image folder (or file) in the tree view
> 3. Open the folder's (or file's) context menu and select Properties
> 4. Here, you can set an expiration date. You can also choose to set any other
> HTTP header, such as CacheControl: no-cache.
>
> In your case, you can either try immediate expiration or set CacheControl:
> no-cache.
>
> Cheers,
> --
> Joerg Jooss
> news-reply@joergjooss.de