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

Change the default Microsoft CDN

8 Answers 129 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Henrik Stig Andersen
Top achievements
Rank 1
Henrik Stig Andersen asked on 28 Mar 2011, 11:59 AM
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

8 Answers, 1 is accepted

Sort by
0
kurt place
Top achievements
Rank 2
answered on 16 Apr 2011, 12:02 AM
I would like to see an answer to this as well.

Kurt
0
Simon
Telerik team
answered on 16 Apr 2011, 01:42 AM
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.

0
Shawn Krivjansky
Top achievements
Rank 1
answered on 13 Oct 2012, 05:44 PM
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.
0
Dimitar Terziev
Telerik team
answered on 16 Oct 2012, 11:38 AM
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.
0
Shawn Krivjansky
Top achievements
Rank 1
answered on 16 Oct 2012, 03:47 PM
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?
0
Dimitar Terziev
Telerik team
answered on 18 Oct 2012, 10:50 AM
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.
0
Shawn Krivjansky
Top achievements
Rank 1
answered on 18 Oct 2012, 04:21 PM
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).
0
Dimitar Terziev
Telerik team
answered on 23 Oct 2012, 03:02 PM
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.
Tags
ScriptManager and StyleSheetManager
Asked by
Henrik Stig Andersen
Top achievements
Rank 1
Answers by
kurt place
Top achievements
Rank 2
Simon
Telerik team
Shawn Krivjansky
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or