开发者

Will Silverlight take too long to load my business app?

I'm thinking that Silverlight 4.0 would be a good choice to build our business application.

However, the one part I'm afraid of is the loading. If I understand it correctly, Silverlight compiles ALL the pages into one binary, which is loaded on the client at load time. It's fine now with just a few pages, but if I reach hundreds of pages, will 开发者_开发知识库this load time get extremely long? When I look at examples on Infragistics and Telerik, they take a good 10-15 seconds to load just those few examples. I find this unacceptable.

Are there ways around this?


Yes, it is indeed a problem. But the binaries (xap files, which are really just a zip of the dlls) are served up via standard HTTP, so they can certainly be cached (as configurable via your web server). So the first download might take 15 seconds, but all subsequent loads should have basically no download time (unless you release an update).

Also, the Telerik examples have all of their dlls referenced, and you can eliminate the ones you don't need in your own project to reduce overall size.

There are several products and techniques for adding additional compression to your xaps (since they are just zip files really)

http://www.google.com/search?q=silverlight+xap+compactor.....

I think Telerik offers one such tool too.

Lastly, in 4.0, you can set certain System dlls to load on demand instead of up front which can improve download time (but I haven't personally used this) - -it's in the project properties.


It's also possible to use multiple xap files, so you could split your application up into seperate xap files.

I've never tried this but if you google then you'll find lots of articles. E.g.

http://dotplusnet.blogspot.com/2010/09/how-to-load-multiple-xap-files-in.html


Firstly - what's likely to bloat the size of the xap are dlls and any imported assets of your own (large images etc). So if you have a relatively homogeneous site, based on the same look / templates across, adding new pages won't increase the overall size much, since the needed components are already in the xap and the additions will mostly consist of text.

Of course, if the new pages have functionality / use controls or components that require additional dlls to be included, that will weigh it down, but when you're talking about one application that could grow to hundreds of pages, I assume they will be somewhat coherent.

You can also have the Silverlight app dynamically load content when needed. If you can separate content and/or content descriptors / assets from the code, you should see whether it's possible to store that in a database or other repository and fetch it only when needed.

It is also possible to load other xaps dynamically at runtime, allowing you to have a lightweight xap load initially, and then bring in the others on demand and thus spread the load time out based on what is required by the user during the "session".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜