Change the default Microsoft CDN

9 posts, 0 answers
  1. Henrik Stig Andersen
    Henrik Stig Andersen avatar
    3 posts
    Member since:
    Feb 2007

    Posted 28 Mar 2011 Link to this post

    I'm using the latest Q1 2011 ASP.NET Ajax.

    when adding the Radscriptmanager to my masterpage I can set the following : 
    EnableCdn="true"

     

     

    However this sets the microsoft scripts to be loaded from: ajax.microsoft.com
    This is an obsolete path and should be replaced with the cookie free alternative: ajax.aspnetcdn.com
    as referenced on: http://www.asp.net/ajaxlibrary/cdn.ashx

    I have found that I manually can do this with the following code:

    <

     

     

    telerik:RadScriptManager ID="sm1" runat="server" EnablePartialRendering="true" EnableCdn

    ="true">

     

    <Scripts>

    <asp:ScriptReference Assembly

    ="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

     

    Name="MicrosoftAjax.js" Path="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"

    />

     

    </Scripts

    >

     

    </telerik:RadScriptManager>

     

     

     


    However it is a rather annoying that I have to add references to all the Microsoft scripts manually.
    My questions are as follows:

    1) Is the way I'm manually refering to ajax.aspnetcdn.com scripts the best/only way to do this?
    2) Will Telerik change the path to ajax.aspnetcdn.com from ajax.microsoft.com in later release?

    best regards
    Thomas
  2. kurt place
    kurt place avatar
    9 posts
    Member since:
    Aug 2012

    Posted 15 Apr 2011 Link to this post

    I would like to see an answer to this as well.

    Kurt
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 15 Apr 2011 Link to this post

    Hi guys,

    Straight to Henrik's questions:
    1. The path to the CDN is hard-coded in the System.Web assembly, so overriding the path of the script reference through the ScriptManager as you have done is the way to go. There is no other place in the API that allows this or at least it is not documented and/or is well-hidden.
    2. In order to change the path we will have to check for each and every script the framework uses (and is available on the CDN) and substitute the paths in the same way. We will consider implementing this in future versions - the cookie-free alternative is definitely the better option.
    I hope this helps.

    All the best,
    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.

  5. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 13 Oct 2012 Link to this post

    I don't understand why Telerik still hasn't updated these references to the newer MS recommended URLs???

    I'm using 2012.2.724 and they are still pointing to the old ajax.microsoft.com urls.

    MS claims there could be up to a 25% increase in performance by using ajax.aspnetcdn.com.  If Telerik is going to have "RadScriptManager" that theoretically inherits "ScriptManger", then I EXPECT it to at least do what ScriptManger does.

    Can we get these references updated?
    It can't be that daunting of a task.  Seems like a find/replace exercise.
  6. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 16 Oct 2012 Link to this post

    Hi,

    With the 2012.2.724 version of the controls, the scripts in question are downloaded from the ajax.aspnetcdn.com address. Here is a short video showing the request using the aforementioned version of the controls.

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 16 Oct 2012 Link to this post

    I would guess you are using a site built on the newest 4.5 framework (looking at the directory that your ajax scripts are being pulled from)??
    Try a site built on 4.0 and show me the same thing?
    See my attachment.
    Otherwise, how can you explain the difference?

    I'm using the 4.0 framework with a web application built using VS 2010 (SP1) and the Telerik ASP.NET AJAX controls 2012.2.724)

    The .net "framework" version does NOT define what reference is used.  MS DOES have the newest references ajax.aspnetcdn.com for the 4.0 framework (and 3.5 for that matter).

    So... my point is...  The Telerik control version that we both are apparently using should be pulling the exact same (NEWEST) reference from MS.  Why aren't they?
  8. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 18 Oct 2012 Link to this post

    Hi,

    The requests from the screenshot provide are with status code 304 which means that they are taken from the cache which is the main idea of the CDN. Please clear your cached and the new requests should be made to the ajax.aspnetcdn.com address. Additionally I have recorded another video showing that my tests are performed on VS2010 with .Net40 web site and the 2012.2.724 version of our controls.

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 18 Oct 2012 Link to this post

    A couple things...
    1) From the video, you are targeting "4.0"... yet, the scripts from the ajax.aspnetcdn.com are coming from the "4.5" area.  How is that??  Shouldn't they be coming from the "4.0" area?  If you target 3.5, they should come from "3.5" and so forth.  All of mine come from the correct framework directory (i.e. if I target 4.0 they come from 4.0 from MS and so on... my problem is they come from the OLD domain.).  Your example does not pickup the correct framework version... conincidently it is the same version from the last video, so maybe you have something setup differently to pull that specific version from that specific CDN domain?

    2) How can my cache have anything to do with this??  That is sorta the whole point of MS switching URLs for their CDN.  If the RadScriptManager is requesting ajax.aspnetcdn.com it is going to look for ajax.aspnetcdn.com in my cache and use my cache if it is there.  If it is NOT there, it is going to pull those scripts down from THAT URL.  If it requests ajax.aspnetcdn.com and finds "ajax.microsoft.com" in my cache it is NOT NOT NOT going to use those scripts because they do NOT match what is being requested...  just the same if it finds google.com in my cache... it isn't going to use that either because it is not the correct URL.  That's how the cache works.  So, I can't see how that has anything whatsoever to do with this problem... but, just to prove the point I cleared the cache.  See attachement ajaxMS2.jpg.  You'll see a full 200 GET request where they are NOT coming from the cache...yet still from ajax.microsoft.com.

    I have also attached ajaxms3.jpg.  This shows my RadScriptManager with "EnableCdn=True".

    Also, not using a "website".  I'm using a "web application" if that makes any difference (vb.net 4.0).
  10. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 23 Oct 2012 Link to this post

    Hello Shawn,

    Indeed the reason why the scripts are downloaded from the new address is caused by the fact that I have the .Net 4.5 framework installed on my machine. Now regarding the situation when this new framework is not being installed. As my colleague Simon has mentioned the path to the CDN is hard-coded in the System.Web assembly so changing this path is not a trivial task. I shall forward this request to our development team and will post any updates on the matter here.

    Kind regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017