HighTechTalks DotNet Forums  

Image does not refresh

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Image does not refresh in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Image does not refresh - 02-01-2006 , 11:24 AM






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


Reply With Quote
  #2  
Old   
Joerg Jooss
 
Posts: n/a

Default Re: Image does not refresh - 02-01-2006 , 01:59 PM






Hello maluco.beleza (AT) gmail (DOT) com,

Quote:
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 (AT) joergjooss (DOT) de




Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Image does not refresh - 02-01-2006 , 10:56 PM




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:
Quote:
Hello maluco.beleza (AT) gmail (DOT) 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 (AT) joergjooss (DOT) de


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.