缺乏 CDN 可用性
我使用 Telerik 和 Microsoft CDN,分别用于它们各自的 AJAX 工具包。两者在 99% 的情况下都工作得很好。然而,我最近在两家不同的咖啡馆工作并访问了我的网站:第一家咖啡馆不允许 Telerik CDN,而第二家咖啡馆不允许 Microsoft CDN 作为 URL 请求。实际上,我可以看到 IE 中的状态栏显示“ajax.microsoft.com”,因为我在等待网站加载时正在检索文件。
缺乏 CDN 访问似乎是一个非常不寻常的问题。事实上,我无法理解为什么当咖啡馆似乎允许几乎所有其他事情时,这样的 URL 请求会被阻止。有什么理由吗?这可能是各个 CDN 本身的可用性问题(即这些 CDN 的可靠性如何)?当然,除了放弃使用 CDN 之外,还有推荐的修复方法吗?
更新:我现在可以连接到我的应用程序。因此,我无法访问 ajax.microsoft.com 很可能是暂时缺乏 MS CDN 可用性,而不是任何域阻止。
I use both Telerik and Microsoft CDN, for their respective AJAX toolkits. Both work great 99% of the time. However, I was working out of two different cafes recently and went to visit my site: The first cafe did not permit the Telerik CDN, while the second one does not allow the Microsoft CDN as a URL request. I can actually see the status bar in IE shows "ajax.microsoft.com" as the file being retrieved as I am waiting for the website to load.
Lack of CDN access seems to be a very unusual problem. In fact, I cannot fathom why such URL requests would be blocked when the cafe seems to permit pretty much everything else. Any reason? Could this be an availability issue at the respective CDNs themselves (ie how reliable are these CDNs)? And of-course, is there a recommended fix, apart from discarding CDN use?
Update: I can now connect to my app. So my lack of access to ajax.microsoft.com was most likely a temporary lack of MS CDN availability, and not any domain blocking.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要做的就是实现回退到本地服务器,如下所述,http://happyworm.com/blog/2010/01/28/a-simple-and-robust-cdn-failover-for-jquery- 14合一/
all you need to do is implement fallback to your local server, explained here, http://happyworm.com/blog/2010/01/28/a-simple-and-robust-cdn-failover-for-jquery-14-in-one-line/
Telerik 在线演示默认使用 CDN,但如果 Amazon 云服务可用,则回退到嵌入式资源不可用。如果您本地安装了 RadControls for ASP.NET AJAX,那么您可以看到演示站点的源代码。您需要查看的文件是 ~/Common/Footer.ascx 及其代码文件 ~/App_Code/QuickStart/Footer.cs,还有
〜/App_Code/QuickStart/QsfCdnConfigurator.cs 〜/App_Code/QuickStart/HeadTag.cs。页脚文件使用 JavaScript 设置 cookie,具体取决于 CDN 是否可用,最后两个文件提供对在服务器端读取 cookie 并为脚本管理器设置适当配置的支持。
The Telerik online demos use the CDN by default, but fallback to embedded resources if the Amazon cloud service is unavailable. If you have the RadControls for ASP.NET AJAX installed locally, then you can see the source of the demo site. The files that you need to review are ~/Common/Footer.ascx and its code file ~/App_Code/QuickStart/Footer.cs, also
~/App_Code/QuickStart/QsfCdnConfigurator.cs ~/App_Code/QuickStart/HeadTag.cs. The Footer files set a cookie using JavaScript, depending on whether the CDN is available and the last two files provide support for reading the cookie on the server side and setting the appropriate configuration for the script manager.