Embedded Scripts make the dll too big

Dec 16, 2008 at 2:42 PM
Hi,

I'm investigating using these controls in mojoPortal. I'm very impressed with the functionality, but the dll is about 9MB. Loading this dll is going to use that much memory on the server and its really too much for many cheap hosting environments. I noticed that the bulk of the size is from the References folder where all the javascript files are being embedded in the dll. Is there any way to compile this without those resources and just include the javascript in the page the normal way? Yahoo provides free hosting of the scripts and now google provides it too and even supports ssl.

I'm going to poke around in the code and look for a way to do this but thought I should ask if there is a way already to do it or if you are considering making it possible to do this.

Best Regards,

Joe Audette
Coordinator
Dec 16, 2008 at 3:44 PM
Hello Joe,

Let's see...

1. I don't think the whole DLL is loaded into memory, so this shouldn't affect site's performance.

2. If you need this now, can get the source code, remove whatever references you don't need, then compile it again. 
You should only leave the minified script versions in production, so you should reach a resonable size.

3. Yahoo and Google CDN support is something I will add the next release.

4. In future releases I will have a production-only version of the YUIAsp.Net controls, with only minified scripts, but not for performance, I am thinking more of download speed of the DLL.

Thanks for using the YUIAsp.Net Controls, I really appreciate your feedback,
Raul
Dec 16, 2008 at 3:58 PM
Hi Raul,

Thanks for your prompt response. Glad to hear #1 is not a problem, I wasn't sure but its so much larger than other dlls in my bin folder it seemed a potential problem.

Looking forward to the CDN support, keep up the great work!

Best,

Joe
Coordinator
Dec 17, 2008 at 11:08 AM
Joe, 

If you checkout the latest sources from svn you will find: 

1. yahoo & google CDN support. Just have a look in the web.config file on how to use it. 
Unfortunately no script combining support yet, I'm looking for the best way to do that.

2. A new solution, postfixed with "-noscripts" which builds the YUIAsp.Net project without embedded resources.

Keep in mind that there might be some bugs left in there...

I will make a release available shortly.

Enjoy,
Raul
Dec 17, 2008 at 11:57 AM
Hi Raul,

This is great! but, could there also be a flag of some kind to make it not add any scripts? I implemented my own solution yesterday for using the google CDN for both jQuery and YUI as I'm already using them in mojoPortal with some controls that I have implemented myself (before I came across your excellent project). So with your new work we now have 2 options, embed the scripts or let YUIAspNet get the scripts from a CDN, and what I'd like is a third option that lets me be responsible for making sure the scripts are available. This would be ideal for me because it make it possible to continue using my current YUI stuff easily in addition to YUIAspNet, I hope it would be easy to add an option for this, if its too much trouble I understand.

Best,

Joe

Coordinator
Dec 17, 2008 at 12:39 PM
You already have that option.

It's a flag in web.config, called EnableEmbeddedScripts

You set it to false, and you take care of the YUI scripts... However, you will have to take care of the YUIAsp.Net custom scripts as well.

This might help a bit: http://yuiasp.net/free-aspnet-controls/docs/General_configuration.aspx

You also have the flag in the demo's web.config, but it's set to true.
Dec 17, 2008 at 12:47 PM
Thanks for your prompt responses, I really appreciate it.
Is there a way to make it embed only the the YUIAsp.Net custom scripts? This would be ideal.

Best,

Joe
Coordinator
Dec 17, 2008 at 1:01 PM
Not yet, but I will study that possibility!

Thanks for the feedbacks, they are appreciated.

Raul
Dec 17, 2008 at 2:40 PM
Hi Raul,

I just got the code from https://YUIAspNet.svn.codeplex.com/svn using TortoiseSVN, but I only see YUIAspNetDemo.sln
Did I misunderstand your previous post? I thought you meant there is a new .sln file named like YUIAspNetDemo-noscripts.sln

Best,

Joe

Coordinator
Dec 17, 2008 at 2:47 PM
You understood correctly, TortoiseSVN refused to add them the first time.
They are there now..