This is a migrated thread and some comments may be shown as answers.

Size of the Telerik.JS file is > 500KB

13 Answers 335 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 01 Dec 2008, 03:35 PM
My team has recently upgraded to the latest version of the RAD controls and is finding the size of the generated Telerik.JS file to be enormous. We are using typical controls just calendars, textboxes, labels and combos on a basic ASP.NET page.

The size of the raw HTML is roughly 50KB which is acceptable but the generated Telerik.JS file for a given page is ranging from 300KB. For a screen with a Grid on it, the Telerik.JS is over 900KB. WebResource.JS is just 20KB or so.

Clearly these Telerik.js files are too large and I'm hoping we're doing something wrong. Would appreciate it if folks could respond with average sizes of these files.

-fs

13 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 02 Dec 2008, 08:34 AM
Hi Francis,

The sizes of the client scripts of RadControls for ASP.NET AJAX can be verified browsing the files under the Scripts folder of your local installation:

C:\Program Files\telerik\RadControls for ASPNET AJAX Q3 2008\Scripts (these are the scripts of the controls separated as external, by default they are embedded as web resource in the Telerik.Web.UI assembly)

Merely the client scripts for the controls you use on the respective page will be registered and downloaded by the browser. In order to combine the scripts of several RadControls, consider utilizing our RadScriptManager which replaces the regular MS ScriptManager control.
 
Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin Babcock
Top achievements
Rank 1
answered on 02 Dec 2008, 07:28 PM
Hi Francis,

I am sorry you are experiencing such large script file sizes. If you use a tool like Firebug for Firefox or Web Development Helper for IE, you can take a look at exactly what scripts are being downloaded. You definitely want to take Sebastian's advice and use a RadScriptManager as this will combine all of you scripts into one file, which will greatly improve the performance of your site (especially if you are using many different controls, all of which have their own script files).

I created a sample project with a RadAjaxManager and a RadGrid which displays ~100 items.The page itself was ~105KB in size. When using a regular ScriptManager control, the initial page load required 18 requests totalling 995.9KB to download all the scripts and resources. Simply adding a RadScriptManager to the page took it down to 9 requests and 738KB. Adding a RadStyleSheetManager reduced it to 7 requests and 738KB.

You'll notice that any time you use a RadControl on your page two things will always be downloaded: the Microsoft ASP.NET AJAX client library (~130KB) and Telerik's core client library (~30KB). Any additional scripts that are downloaded depend on what controls and features you have implemented in your page. However, what you need to remember is that all of these script resources are cached. So while the initial page load may take a few extra seconds to download the script files, the remaining page loads will be much faster because the script files are already cached on the client and do not need to be re-downloaded. For example, the page I was just describing only requires ~112KB for all subsequent requests.

I suggest you take a look at Todd Anglin's Optimization Tips if you are interested in learning more about how to optimize your pages with the RadControls.

I hope this has been helpful. If you have any further questions, please don't hesitate to ask.

Regards,
Kevin Babcock
0
Jacky Chau
Top achievements
Rank 1
answered on 28 Dec 2008, 07:47 AM
Doesn't RadScriptManager generate a unique webresource link per page when combining scripts?  For example, my website has 5 pages (page1, page2, etc).  Won't each page get a different webresource link so instead of caching MS AJAX.NET script 1 time, it will be cached 5 times if an user visit all 5 pages?
0
Erjan Gavalji
Telerik team
answered on 29 Dec 2008, 12:02 PM
Hi Jacky Chau,

Actually that depends on the control set used by the pages. If PageA uses RadTreeView and RadGrid and PageB uses the same controls (RadTreeView and RadGrid), users, visited PageA will get the scripts cached in PageB, because the RadScriptManager URL is the same.

It is true that if the control sets are different on all pages (e.g. PageA - RadTreeView and RadGrid, PageB - RadTreeView and RadComboBox), users will download MS Ajax scripts, Telerik Common scripts and RadTreeView scripts twice. Indeed, this way the first load of a page with a different control set is heavier than having the scripts not combined. The benefit is that during the subsequent visits the browser roundtrip time is limited to a single request.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chit
Top achievements
Rank 1
answered on 10 Feb 2009, 06:36 PM

Hi Sebastian,

Yes, but even though by default they are (Scripts) embedded in Telerik.Web.UI, does you have any option to limit embedded scripts.

i.e In my pages I never used ‘Chart’, ’ColorPicker’, ‘Dock’ and etc. therefore its unnecessary to load such scripts with ‘Telerik.js’.



Regards,
Chit
0
Veselin Vasilev
Telerik team
answered on 11 Feb 2009, 08:41 AM
Hello Chit,

The browser downloads only the needed scripts.
So, if your page does not use RadTreeView, the RadTreeView.js file will never be downloaded.

On this page you will see which script files are required (and downloaded) by each product.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Yousuf Mohammed
Top achievements
Rank 1
answered on 16 Nov 2009, 09:17 PM
Hi

I am having RadScriptManager in masterpage. And I login as two different users from the same machine to same page and what I see is that RadScriptManager downloads the same script twice. I am using firebug to monitor http requests. WeResource.axd file url is different for different sessions coming from same machine.  

http://localhost/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&
compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2008.3.1314.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%
3aef502ffb-86f7-4d96-ad3a-fbb934d602ab%3a16e4e7cd%3a19620875%3ae330518b%3a1e771326%3ac8618e41%3af7645509%3ae524c98b%3a58366029%3aed16cbdc%3a874f8ea2%3a33108d14%3abd8f85e4


http://localhost/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&
compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2008.3.1314.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%
3aef502ffb-86f7-4d96-ad3a-fbb934d602ab%3a16e4e7cd%3a19620875%3a1e771326%3aaa288e2d%3ae330518b%3ac8618e41%3a874f8ea2%3a39040b5c%3af7645509%3ae524c98b%3aed16cbdc%3a58366029%3a33108d14%3abd8f85e4

Please let me know if there is a way to cache WeResource.axd file for different sessions coming from same machine?.I am working on a intranet application and most of the time users login with different credentials from the same computer. 

Thanks

-Yousuf
0
Paul
Telerik team
answered on 19 Nov 2009, 01:25 PM
Hello Yousuf Mohammed,

Browsers' cache is generally unique for the logged user (that's how operating systems and browsers work). In a word, it's normal for two different users the browser to download a fresh copy of a file from the server and store it for both users.

Greetings,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
NIRAKAR
Top achievements
Rank 1
answered on 27 Apr 2010, 08:11 AM
Hi,

your above explanations are correct, but how to reduce the size of telerik.js file. Because at the time of load is taking more time and it's size is more than 1mb. Please suggest the alternate solution.

Nirakar.
0
Basel Nimer
Top achievements
Rank 2
answered on 10 Jun 2010, 01:09 PM
i re-say what Nirakar is saying.

0
T. Tsonev
Telerik team
answered on 10 Jun 2010, 01:17 PM
Hello,

Depending on how many controls you load the size of the JavaScript can indeed grow pretty large. You can also consider using the Telerik CDN:

http://blogs.telerik.com/blogs/posts/09-12-08/cdn_support_ndash_radcontrols_for_asp_net_ajax.aspx

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alaa Majzoub
Top achievements
Rank 2
answered on 10 Jun 2010, 05:18 PM
yes, I read about this in another post. The problem is that i am using Q2.2009

which opens another question, can i use the new version Q1.2010 smoothly? do i need to do many changes?

BTW: it is still me (Basel)
0
Sebastian
Telerik team
answered on 14 Jun 2010, 12:47 PM
Hello Basel,

Complete list with the changes made since the Q2 2009 release of RadControls for ASP.NET AJAX till now you can find in this article from the product documentation. Upgrade instructions are available here.

Greetings,
Sebastian
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Francis
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Kevin Babcock
Top achievements
Rank 1
Jacky Chau
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Chit
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Yousuf Mohammed
Top achievements
Rank 1
Paul
Telerik team
NIRAKAR
Top achievements
Rank 1
Basel Nimer
Top achievements
Rank 2
T. Tsonev
Telerik team
Alaa Majzoub
Top achievements
Rank 2
Share this question
or