SilverlightShow: Caching of, in, and around your Silverlight application (part 1) Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) Re: Caching of, in, and around your Silverlight application (part 1) <p>Mr. Kevin Dockx:</p> <p> Thank you for posting the information about Assembly Caching associated with Silverlight XAP files.  It made our Silverlight / Pivot Viewer module within our Web application run at least 30% faster.</p> <p> Thanks,</p> <p> Web Developer </p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment8975 newemployee909090 http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Thu, 21 Feb 2013 23:29:19 GMT Re: Caching of, in, and around your Silverlight application (part 1) <span style="color: #aaaaaa; font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: #f7f7f7;">@<span style="color: #aaaaaa; font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: #f7f7f7;">steve buddy: No, the code above is for OOB applications.  OOB applications have no support for Assembly Caching.</span></span> <p><span style="color: #aaaaaa; font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: #f7f7f7;"><br /> </span></p> <p><span style="color: #aaaaaa; font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: #f7f7f7;">@Rakun: The Controls.Toolkit assembly is from the Silverlight toolkit - you need to have that installed to be able to run the example code.</span></p> <p><span style="color: #aaaaaa; font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; font-size: 12px; line-height: 20px; white-space: nowrap; background-color: #f7f7f7;"><br /> </span></p> <p><span style="font-family: 'segoe ui', helvetica, arial, verdana, tahoma, sans-serif; color: #aaaaaa; font-size: 12px; line-height: 20px; white-space: nowrap;">Hope this helps!</span></p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment6518 KevinDockx http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Tue, 13 Sep 2011 11:11:00 GMT Re: Caching of, in, and around your Silverlight application (part 1) <p>Hi Gill</p> <p>when I downloaded the source code & run it on my system it throws error like</p> <p>"Line: 54<br /> Error: Unhandled Error in Silverlight Application <br /> Code: 2152    <br /> Category: InitializeError       <br /> Message: Failed to download a platform extension: System.Windows.Controls.Toolkit.zip     <br /> "</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment6517 Rakun http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Tue, 13 Sep 2011 09:02:46 GMT Re: Caching of, in, and around your Silverlight application (part 1) <p>Hi Gill</p> <p>when I downloaded the source code & run it on my system it throws error like</p> <p>"Line: 54<br /> Error: Unhandled Error in Silverlight Application <br /> Code: 2152    <br /> Category: InitializeError       <br /> Message: Failed to download a platform extension: System.Windows.Controls.Toolkit.zip     <br /> "</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment6516 Rakun http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Tue, 13 Sep 2011 08:48:43 GMT Will above source code automatically download new versions everytime silver application is reloaded in browser if needed <p>I have a coupld question on assembly caching and I will relate it to the above source code.</p> <p>When first loading the silverlight application into a browser is the System.Windows.Controls.Toolkit.zip and System.Windows.Controls.zip files automatically download for the first time, and then using the code shown above and below will automatically download the same to files from the server if the files cache in the browser are different from the one on the server when the silver application is reloaded in the browser? Is this correct?</p> <p>   this.CheckAndDownloadUpdateCompleted += (send, args) => <br> </br>        { <br> </br>            if (args.UpdateAvailable) <br> </br>            { <br> </br>                MessageBox.Show("A new version of the application is downloaded, please restart the application to launch the new version."); <br> </br>            } <br> </br>        }; <br> </br>    this.CheckAndDownloadUpdateAsync();</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment5627 steve buddy http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Wed, 02 Mar 2011 04:30:21 GMT RE: Caching of, in, and around your Silverlight application (part 1) Hi, if a user clears their browser's temporary internet files, does that clear the OOB assembly files - i.e. does tne user at that point lose the ability to run offline OOB until they go back online and re-load the app? http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment5488 David C http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Sat, 12 Feb 2011 20:22:18 GMT RE: Caching of, in, and around your Silverlight application (part 1) <p>There is a much simpler way to use the browser's cache: append the version of your XAP to the URI for it. Browsers equate cached objects with URI's, so once your version changes, so does the URI, and that forces the browser to download the new version. It's as simple as doing this in your object tag:</p> <p><param name="source" value="/path/to/your/app.xap?<%= typeof(SomethingOnYourServerThatHasTheSameVersionAsYourXAP).Assembly().GetName().Version.ToString() %>"</p> <p>now your URI's look like:</p> <p>app.xap?1.0.1.2</p> <p>app.xap?1.0.1.3</p> <p>app.xap?1.0.1.4</p> <p>etc</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4978 Matt http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Mon, 29 Nov 2010 17:30:09 GMT RE: Caching of, in, and around your Silverlight application (part 1) <p>Thanks Kevin, I would really love to see an article on OOB assembly caching (even if it is a custom solution using Isolated Storage) - I think this would be really helpful).</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4949 Rodney http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Tue, 23 Nov 2010 22:40:33 GMT RE: Caching of, in, and around your Silverlight application (part 1) <p>Kevin, we are using MSBUILD, I will look into setting the expiration. The real issue is I dont want it to expire immediately because then the silverlight app will reload every time and I need the caching so that users dont have to wait for the app to load. I started looking at this article <a href="http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/">http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/</a>. Just havent hide time to follow through with it.</p> <p> </p> <p>Thanks for the response</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4944 Steve White http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Tue, 23 Nov 2010 15:14:02 GMT RE: Caching of, in, and around your Silverlight application (part 1) <p>@Steve: are these web app packages you're using, or the Publish option from VS?  With those packages, you can deploy your IIS settings as well - one option would be to set the expiration on current date + xx minutes, so after deploy, the content would expire very fast.</p> <p>@Rodney: I'm not sure on Microsofts' reasoning on this.  There *are* ways around this, however: you could use the Isolated Storage to cache your external assemblies as well, or even the complete XAP(s).  However, this will require a lot of plumbing...</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4937 KevinDockx http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Mon, 22 Nov 2010 18:36:04 GMT RE: Caching of, in, and around your Silverlight application (part 1) What do you suggest when you have 30 IIS servers hosting the application? For us an ideal situatuion is that the xap file would cache indefinately unitl i put a new version up to the IIS server. We have build jobs that we run to deploy it to our iis servers. http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4936 Steve White http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Mon, 22 Nov 2010 16:06:15 GMT RE: Caching of, in, and around your Silverlight application (part 1) <p>I really don't understand why assembly caching does not work in OOB. Is it a technical reason (I can't think of one)... I would guess that the majority of LOB apps are OOB...</p> http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4913 Rodney http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Fri, 19 Nov 2010 00:58:35 GMT RE: Caching of, in, and around your Silverlight application (part 1) Thank you,  I have known about zap caching for a while but always wondered about the workings.  I look forward to the other two parts! http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx#comment4909 Adam http://www.silverlightshow.net/items/Caching-of-in-and-around-your-Silverlight-application-part-1.aspx Thu, 18 Nov 2010 19:50:54 GMT