If my asp.net website has some silverlight content(XAP file, silverlight video content), does user have to download all content everytime he open my website in browser, or date stay saved/cached on Hard Drive even if user turn of computer? In what folder data is saved and how long does it stay saved? I read somewhere about "Reduce XAP size by using application library caching" option when creating silverlight project. Is that option enabled by default(Don't have Silverlight installed in VS)?
I recommend on reading up on Silverlight and XAP caching here. In short, yes, the Silverlight XAP is cached and only re-loaded when the XAP has been modified or your browser's cache has been cleared.
The browser will cache resources, libraries, xaml, and binaries needed to run the application. This is handled by the browser cache and your files are stored in the temporary internet files directory.
Assembly caching allows your assemblies to be cached by the browser separately from your XAP file. The benefit of this is that you can update your XAP and the browser not have to re-download your assemblies, just the updated XAP file. This can make a big difference in downloads speeds when users re-visit your site.
Sometimes, caching a XAP file can work against you as publishing an update doesn't necessarily dirty the cache. IE handles updates better than Chrome and Firefox. The link above shows you how to configure IIS to immediately expire the web content on publish. This CodeProject link also has a good method for updating the ASP.NET page content with a dynamic string to force a cache refresh on publish.
Related
I am working on a spring framework project optimization. Its taking 2 minutes+ to load. When I checked in
Network console, it was js, css content download which were the main reason. 200KB file taking 2 minutes to be downloaded. Every 1KB taking 2-8 Seconds to be downloaded(other files).
Generated .war file relocating those css, js files in webroot but nothing improved.Where should I investigate to find the delay in content download? Could modifying .jsp files directly in .war file be helpful? It's not in localhost, I am deploying it in User Acceptance Testing server(UAT).
Tech Stack : Spring framework, Angular, GWT.
I have a website developed in AngularJS, and index.html serves the root of the application.
All the JS and CSS versions are maintained in the index.html itself, which means for any changes to reflect to the user, "index.html" is to be reloaded at the browser.(correct me if I am wrong here).
This is a problem, since there could be chances that the user has a tab opened of our website in his browser and we have published a new release. This release will not be published at user's browser till the time a "Manual refresh" is not triggered and "index.html" is not reloaded and hence bring up the possibility that the user will not be using our latest release.
We have written a framework to reload all resources once a release is detected by sending the latest version from web-server and comparing this with the current version in the browser and trigger a reload automatically. This fix works fine, but the problem again is, how to publish this release first time to all user's browser?
I hope you get my problem? let me know otherwise.
This is not possible. There is no way to force an open page to refresh if it does not already have code to implement that feature. You will have to wait until the user refreshes it themselves, and the browser cache expires, and any intermediate caches between the user and your servers.
I recommend searching to learn about "HTTP caching" if you are not already familiar, as well as "cache busting." In general, you may want to consider making index.html a small file that references your big files in <script> tags, setting the cache control for index.html very low, and use cache busting techniques on your big files.
But for your first release, there is no way to invalidate open tabs or existing caches. If this will cause a problem with your server, read up on "API versioning" for different ways to handle it.
I'm running a Silverlight out-of-browser desktop application that downloads a bunch of images from an HTTP server. It seems as though Silverlight has a local image cache that it uses for the images, even across multiple instantiations of the application. If I update an image on the HTTP server, I would like the updated image to be displayed in the Silverlight application, rather than the version of the image stored in the Silverlight image cache. How do I go about clearing the image cache on my machine?
Clearing my web browser's image cache doesn't work here because the Silverlight application is running as an out-of browser desktop application.
Note: I'm not interested in clearing the cache programmatically, I want to be able to do this by either changing a setting on my machine (to disable the image cache) or deleting a directory where the images are stored.
To clear the Silverlight cache, use the following steps:
1) Start up the Silverlight application of interest
2) Right click anywhere inside the application and click ‘Silverlight’
3) Click on the “Application Storage” Tab
4) Choose the application (website) of interest and click "Delete..."
-or-
4) Click "Delete All" to delete the cache for all Silverlight applications
If you don't want applications to ever cache, clear the "Enable application storage" checkbox, but this is not necessarily recommended.
http://www.microsoft.com/getsilverlight/resources/documentation/AppStorage.aspx
Apparently you are correct. It is broken.
Found this link which may explain the problem and a workaround: Caching of, in, and around your Silverlight application (part 1)
I am developing a Silverlight 4 application which displays items in a carousel control. The items are parsed form an XML file and then loaded as an image which can be double clicked to open a website, file, image etc.
I am already running in higher privileges mode (out of browser) to access the Xml file which sits in a subfolder of the application.
I can load the images fine when they are added to the project as they are included as resources. However, I need to be able to load images which aren't individually added to the project. Instead, I would like to add all images in a particular folder as resources.
Is this possible?
Thanks in advance
From Advanced Silverlight Out of Browser- Introduction
When running in a trusted environment,
you can access only files in user
folders, specifically the MyDocuments,
MyMusic, MyPictures, and MyVideos
folders
So, if you want to access folders other than this, you would probably need to run some sort of service, which has the proper rights. What kind of service depends on where this app is running. Could be a WCF service, or a simple WebService, if you can run a webserver on the machine. Otherwise, you'd need a windows service of some sort.
Inside my Silverlight app, i use reflection to load an assembly. While the app is running, the version and content of that assembly can change. I know the moment, when it changes, now I want to trigger the complete reload of the app, so that assembly is reloaded too with the new version. How to do that?
You can reload the page that hosts the silverlight application, so the application is also reloaded: it's just one line:
System.Windows.Browser.HtmlPage.Document.Submit();
If you have problems with the browser's cache, check out this question:
How do you force Firefox to not cache or re-download a Silverlight XAP file?