Silverlight Release optimization work (top)

Source: Internet
Author: User
Keywords caching optimizing work can this
Tags application cache caching change client development download http

The recent development, Silverlight xap More and more large, if not optimized to seriously affect the client experience, so read some information, summed up.

The XAP package is biodegradable

Silverlight applications are ultimately the use of HTTP protocol to the web to reach the client, we write the Silverlight package is XAP, is actually a compressed package, contains a number of controls and resources, you can change the suffix to zip, through the right key to open a probe.

Change the suffix and then use the compression software to open it and discover it.

After understanding this basic knowledge, you can start the optimization work from the decomposition of this XAP package, where the optimization is divided into two parts:

Silverlight client-side caching validates the decomposition of the DLL decomposition resource for Silverlight itself

Validation of Silverlight Cache Resources

Silverlight can cache resources at the client, one download, and reuse.

This can be tested by fiddler the load of the resource.

Iii. use of Silverlight in VS2010 Select the "Application Library cache reduce XAP volume" to control the only DLLs needed to download each time.

Add a ChildWindow to the SL project, and then we'll rewrite the MainPage.xaml.cs code:

Public MainPage ()
{
InitializeComponent ();
This. Loaded + = new Routedeventhandler (mainpage_loaded);
}

void Mainpage_loaded (object sender, RoutedEventArgs e)
{
Test T = new Test ();
T.show ();
}

is to eject a child window while loading, and then compiling the solution will find:

There is a System.Windows.Controls.zip file in the ClientBin folder under the Web, this is because the above option is selected, using fiddler monitoring will find that the first load if the child window does not open, it will not load system.windows.controls.zip This bag.

Iv. Controlling picture Resources

We can set the picture resource to content and place the picture in a folder under the Web, which greatly reduces the volume of the XAP package and saves the next download by using the cached HTTP request resources from the browser, if you split the Silverlight DLL and resources away, Will reduce the volume of xap downloads and shorten the wait time, and you can use IIS to do ordinary picture downloads, using the browser's own caching capabilities to cache the first requested picture for backup.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.