When setting the properties for a silverlight app, I see the unchecked boxes:
- Reduce XAP size by using application library caching
- Use GPU Acceleration
Smaller download size and faster speed sound good to me, which makes me wonder why these aren't turned on by default.
What are the drawbacks of these choices then?
Reduce XAP size by using application library caching
This reduces the XAP size by allowing those libraries configured with a dllname
.extmap.xml file to be placed in individual zip files. These zip files will be requested as part of the initial XAP download.
The advantage comes in two scenarios. First if you update your code and rebuild the XAP most of the time the only thing that changes is the XAP, zip files remain unchanged. Hence when a client revisits your app and needs to download the latest version it may well be that only the XAP gets fetched, the zips being the same get served out of the browser cache (probably after a "304 Not Modified" response from the server).
The other scenario is where you have multiple SL applications on your site. They will share the same zips and therefore the total download for multiple apps is much reduced.
For a one off application the first client visit will be a download at least as expensive if not more expensive than had the all the libraries been kept in the XAP. In some uses (high number of unique visitors of a site with a single app) it may be more desirable to keep the single XAP, especially if the XAP itself doesn't change that often.
Where there are multiple XAPs sharing the same set of library zips there is a danger of "DLL Hell". Potentially someone can update a XAP which uses newer versions of libraries that the other XAPS have not been tested with and inadvertently break all the other XAPS. There are good practices that can eliminate this problem but it takes a little more effort than flicking on the Checkbox.
In light particularly of the second disadvantage I think it was a sensible choice not to default this feature on.
Use GPU Acceleration
I'm not going to go into the advantages/disadvantages of this. Just answer why its off by default.
You don't get any advantage by just turning it on, you need to enable which elements in the XAML will get to use it via the
CacheMode property. In addition depending on what you are doing this may still not bring you any advantages.
Just turning it on will consume extra resources such as video memory, you wouldn't want that to happen unless you've specfically gone ahead used
CacheMode at least somewhere in your app and hopefully where it would make a real difference. Also it is possible to get it wrong and make things worse.