我应该链接到 Google API 的 JS 库云吗? [英] Should I link to Google API's cloud for JS libraries?

查看:35
本文介绍了我应该链接到 Google API 的 JS 库云吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找拉动 jQuery & 的利弊.来自 Google API 云的其他 JS 库,而不是直接下载文件和部署.

I'm looking for the pros/cons of pulling jQuery & other JS libraries from Google API's cloud as opposed to downloading files and deploying directly.

你说什么?

lib 已经缓存在用户系统上的可能性对我来说是最重要的因素,所以我将使用指向 googleapis.com 的永久链接(例如 ajax.googleapis.com/ajax/libs/...).我同意这里的其他人的观点,即失去对 Google 服务器云的访问权限是最小的问题.

The likelihood of the lib already cached on the users system is the overriding factor for me, so I'm going with a permalink to googleapis.com (e.g. ajax.googleapis.com/ajax/libs/…). I agree with others here that loss of access to the Google server cloud is a minimal concern.

推荐答案

优点:它可能已经缓存在用户的系统上.谷歌有很大的管道.您无需为带宽付费.

Pros: It may already be cached on the user's system. Google has big pipes. You don't pay for the bandwidth.

缺点:您现在有两种不同的方式使您的网站变得不可用:您的服务器上的服务中断或 Google 的服务器上的一种中断.

Cons: You now have two different ways for your site to become unavailable: A service interruption on your server or one on Google's server.

这篇关于我应该链接到 Google API 的 JS 库云吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆