How can I use static .js files?

7 posts, 0 answers
  1. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 27 May 2011 Link to this post

    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
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 03 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 03 Jun 2011 Link to this post

    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. 
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 08 Jun 2011 Link to this post

    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.

  6. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 08 Jun 2011 Link to this post

    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
  7. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 08 Jun 2011 Link to this post

    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.

  8. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 08 Jun 2011 Link to this post

    Sounds good thanks Simon.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017