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

CDN fallback

9 Answers 151 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 07 Mar 2012, 04:28 PM
If the telerik static CDN is not available, will it fallback to pulling the CSS from my server?  If not, is it feasible for you to add that feature?  Even though it is not likely that the Amazon CDN would not be available, you can never completely rely on cloud services, as seen from the recent Azure downtime.  I would appreciate your thoughts on this one.

9 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 12 Mar 2012, 12:39 PM
Hi,

In case the Amazon cloud service is not available for some reason, the styles or script won't be loaded. This is the standard behavior of the RadScriptManager/RadStyleSheetManager and currently we have no plans of changing it.

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.
0
Michael
Top achievements
Rank 1
answered on 12 Mar 2012, 02:40 PM
If by "standard behavior", you mean that it doesn't have that feature, then I agree.  :)   No "cloud" service can ever be 100% reliable, but the combination of a cloud service and my own servers as a fallback would be ideal to me.  If there is no way you would add a feature like that, do you have any suggestions on how I could handle it myself?
0
Dimitar Terziev
Telerik team
answered on 15 Mar 2012, 01:23 PM
Hello,

You are right that relying only on a cloud service is not the most reliable solution and providing a back-up is a good approach. In general you could check whether the cloud service is available and if not you should alter the BaseUrl and BaseSecureUrl  properties of RadScriptManager's CDN settings to redirect the user to other CDN provider or simply disable it through the TelerikCdn property.


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
SK
Top achievements
Rank 1
answered on 15 Aug 2012, 06:03 AM
Hello,
 Would it be possible to provide a code sample of this approach?
I.e. checking if the CDN is available, and if not changing the BaseURL/disabling CDN via the flags?

Thanks,
 
0
Peter Filipov
Telerik team
answered on 17 Aug 2012, 09:57 AM
Hi Sajit,

I did a research regarding your questions and found the following helpful post. The overload parameter is the address of the located resources e.g. "http://aspnet-scripts.telerikstatic.com/ajaxz/2012.2.815/Common/jQuery.js"
public bool IsAddressAvailable(string address)
{
    try
    {
        System.Net.WebClient client = new WebClient();
        client.DownloadData(address);
        return true;
    }
    catch
    {
        return false;
    }
}


All the best,
Peter Filipov
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
SK
Top achievements
Rank 1
answered on 17 Aug 2012, 05:19 PM
Hi Peter,
 Thank you for the reply, but this would test connectivity from the server, wouldn't it?

My use case is as follows: I have users who can connect to my website from their home office, as well as the work sites. When at work they have to configure a proxy to access the internet. In some cases, the switch over from their homes (where they use a VPN) to the work network does not go well, and the proxy is not configured correctly. 
I also have users in other countries where connectivity may not be guaranteed or not available due to their work site policies.

I would like to:
1. Fail over transparently to the local copies of the JS files that I use   and/or
2. Present a notification to the user saying that because internet connectivity is not available, the website may work slowly.

With Javascript in the <head> tag, I could do something like
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
<script type="text/javascript">typeof Sys === 'undefined'
|| document.write('<script src="~/scripts/MicrosoftAjax.js">\x3C/script>')</script>

I want to find out how to do the same with the RadScriptManager and setting (the server side) CdnSettings-TelerikCdn flag.

Thanks in advance,
0
Peter Filipov
Telerik team
answered on 22 Aug 2012, 02:51 PM
Hello Sajit,

I am afraid that it is not possible to achieve the described scenario. In case that we find out a way to resolve similar cases we are going to add it in our documentation or resources.

Regards,
Peter Filipov
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
Martin de Ruiter
Top achievements
Rank 2
answered on 30 Aug 2012, 10:18 PM
I would like to see CDN fallback to local support added to RadScriptManager/RadStyleSheetManager as well. Can you perhaps create an entry in PITS?
0
Peter Filipov
Telerik team
answered on 04 Sep 2012, 10:28 AM
Hello,

I just created a PITS item. Please give your votes here. Keep in mind that you need to wait a little until the item is loaded.

Regards,
Peter Filipov
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
Michael
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Michael
Top achievements
Rank 1
SK
Top achievements
Rank 1
Peter Filipov
Telerik team
Martin de Ruiter
Top achievements
Rank 2
Share this question
or