Page view counter

Silverlight Tips of the Day - Blog by Mike Snow

Game Programming with Silverlight

Silverlight Tip of the Day #102 - Bypassing the Image Cache

This blog has been migrated to the new blog site:

http://www.michaelsnow.com/2010/05/07/silverlight-tip-of-the-day-16-working-with-ignoreimagecache/

Comments

Microsoft Weblogs said:

By default Silverlight will not download an image more than once if is contained within the image cache

# March 25, 2009 1:55 PM

GearWorld said:

Yeah and what you do is waiting for everybody to have downloaded the new images then you remove the IgnoreImageCache so it doesn't send the image everytime ?

# March 25, 2009 4:43 PM

mike.snow said:

Yes. For example, you can program your app to have a "refresh" button that refershes the images only when the button is pressed. Or something similiar...

# March 25, 2009 4:48 PM

tgrand said:

Isn't this why browser caches are supposed to use things like timestamps, serial numbers, and expiration dates?  Are you saying those mechanisms are ineffective or not used when downloading images with SL?

# March 26, 2009 10:30 AM

mike.snow said:

I believe they are effective but if this is useful if your app needs to update the images before the expiration date occurs.

# March 26, 2009 10:35 AM

Eric Willeke said:

Is this SL3? You have it tagged with both, but I've never noticed this in SL2.

# March 26, 2009 1:34 PM

mike.snow said:

Sorry, yes this is just SL3. I didn't mean to tag Sl2.

# March 26, 2009 2:40 PM

Eric Willeke said:

So, what other image options are there now? I'm the architect on Inkubook.com, and we do a LOT of image manipulation all things considered. I haven't, unfortunately, taken the time to dig into the new parts yet, mostly just checking for upgrade compatability with the current site.

# March 27, 2009 1:31 PM

mike.snow said:

I'll have to look into it myself. This is the only new one I am aware of. Thanks.

# March 30, 2009 12:36 PM

Visual Web Developer Team Blog said:

Most Recent Posts: Silverlight Tip of the Day #106 - Setting Default Browser from within VS Silverlight

# April 6, 2009 6:13 PM

Silverlight Tips of the Day - Blog by Mike Snow said:

The purpose of this post is to create an outline summary all the blogs from my Silverlight Tips of the

# April 6, 2009 6:20 PM

Бюллетень cильверлайтера said:

Бюллетень Сильверлайтера. Выпуск №2. 9 Мая 2009 года. Здравствуйте, уважаемые сильверлайтеры! Вот и прошёл

# May 9, 2009 10:50 AM

NewsPeeps said:

Thank you for submitting this cool story - Trackback from NewsPeeps

# August 8, 2009 6:36 PM

Silverlight Tip of the Day #102 - Bypassing the Image Cache … Silverlight Blog said:

Pingback from  Silverlight Tip of the Day #102 - Bypassing the Image Cache … Silverlight Blog

# November 3, 2009 6:30 PM

MoiFou said:

The MSDN topic at msdn.microsoft.com/.../system.windows.media.imaging.bitmapcreateoptions(VS.95).aspx has this description of the IgnoreImageCache parameter of the BitmapCreateOptions enum:

"Loads images without using an existing image cache. This option should only be selected when images in a cache need to be refreshed.... When IgnoreImageCache is selected, any existing entries in the image cache are replaced, even if they share the same URI."

I can't seem to reconcile this description.  It seems to contradict itself, and your tip.  

Can you tell me, if IgnoreImageCache is set, is the image contained in the BitmapImage or BitmapSource object in the image cache, or outside of the image cache?  If it's outside, why would "existing entries in the image cache are replaced"?

Thanks for any help.

# November 25, 2009 12:10 AM

Juncheng said:

I am developing a silverlight application. In this application, the silverLight control send request to WCF to update the image on server, I would like to update the image display on client browser. I attach an event ChartCreateCompleted and it does get called. however, the silver control still display image which come from the previous run. I wish anyone can help me out. thank you very much.

the following are the codes I have

      private void ChartCreateCompleted(object sender, chartsvc.updateChartCompletedEventArgs e)

      {

          int reslt = e.Result;

          if (reslt == 0) //successs

          {

              #region Commented

              DefectsInfo.UpdateLayout(); //DefectsInfo is a silverlight window panel

              Uri uri = new Uri("blank.png", UriKind.Relative);

              ImageSource img = new System.Windows.Media.Imaging.BitmapImage(uri);

              columnChart.SetValue(Image.SourceProperty, img); //columnChart is an Image Control on this window panel

              columnChart.Source = img;

              System.Threading.Thread.Sleep(500);

              uri = new Uri("juncheng_dell/.../columnChart.png", UriKind.Absolute);

              img = new System.Windows.Media.Imaging.BitmapImage(uri);

              columnChart.SetValue(Image.SourceProperty, img);

              columnChart.Source = img;

              System.Threading.Thread.Sleep(500);

              #endregion

          }

          else //error

          {

              //Uri uri = new Uri("Blank.png", UriKind.Relative);

              //ImageSource img = new System.Windows.Media.Imaging.BitmapImage(uri);

              //columnChart.SetValue(Image.SourceProperty, img);

          }

      }

# June 3, 2010 8:43 AM