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

How can I use static .js files?

6 Answers 94 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Aaron C
Top achievements
Rank 1
Aaron C asked on 27 May 2011, 04:20 PM
Hello, how can I use RadScriptManager in a way that will download static javascript files from my site, similar to how your CDN works?  I would like to get the benefits of caching these, is there any way to do this without setting up my own CDN?  Ideally I would like to use your CDN by default and mine as an emergency fallback, is there any way to do this? 

Thanks,
Aaron

6 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 03 Jun 2011, 05:40 PM
Hello Aaron C,

Could you please elaborate more on this requirement? Are the JavaScript files those of RadControls or some custom files you are using in your application?

Regards,
Simon
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Aaron C
Top achievements
Rank 1
answered on 03 Jun 2011, 05:50 PM
Hi Simon,

I would like to cache the javascript files from RadControls.  I have set up a local custom CDN for my site, and that allows me to get the benefits of caching, but now I do not get the benefits of combining script files - fewer http requests to my server.  Is there any way that I could manually combine the js files in the CDN distribution?  The default behavior of the script manager causes a large amount of duplicate javascript to be transferred, and I am trying to avoid this. 
0
Simon
Telerik team
answered on 08 Jun 2011, 11:37 AM
Hi Aaron C,

Thank you for getting back to me and providing the additional info.

First, the problem with combining JS (and CSS) resources is that on each page the set of resources to combine differs, i.e. is unique, in most of the cases. So they must be combined dynamically in order to always combine the required minimum. Otherwise, one would have to combine *all* resources in one file so that all cases are covered. The downside of this is that the size of such a file will be very large and not optimal.

Second, when requested from CDN resources come separately, again for the same reason as above - there is no way for us to know each possible combination of resources that will ever be requested and provide combined resources for each case.

Third, we have some solutions in mind. One would allow you to specif some of the resources to be excluded from combining. This will allow the browser to cache these resources and later load only them from cache when required.

The second solution is to provide ways of combining resources in groups. For instance you may choose to combine the RadComboBox scripts into one separate file, so that this file is cached and reused across pages.

So I hope I have given you a better idea of how and why RadScriptManager works in this way and what are our plans of improving it.

Regards,
Simon
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Aaron C
Top achievements
Rank 1
answered on 08 Jun 2011, 02:28 PM
Hi Simon,

That makes sense, I see why the RadScriptManager works in this way, and for my uses I really like the second solution you proposed:

"The second solution is to provide ways of combining resources in groups. For instance you may choose to combine the RadComboBox scripts into one separate file, so that this file is cached and reused across pages."

I think that this would work well for our site. If we could load a subset of the combined scripts on our homepage, then the rest of the site could use a larger combined file, this would give us the benefits we are looking for.

Is this something that is possible with the current RadSCriptManager or do we need to wait for a future version?

Thanks,
Aaron
0
Simon
Telerik team
answered on 08 Jun 2011, 03:23 PM
Hello Aaron C,

We are working on this feature right now and it will be available in the next version - Q2 2011.

Regards,
Simon
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Aaron C
Top achievements
Rank 1
answered on 08 Jun 2011, 04:30 PM
Sounds good thanks Simon.
Tags
ScriptManager and StyleSheetManager
Asked by
Aaron C
Top achievements
Rank 1
Answers by
Simon
Telerik team
Aaron C
Top achievements
Rank 1
Share this question
or