問題描述
我正在尋找拉動 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 已經(jīng)緩存在用戶系統(tǒng)上的可能性對我來說是最重要的因素,所以我將使用指向 googleapis.com 的永久鏈接(例如 ajax.googleapis.com/ajax/libs/...).我同意這里的其他人的觀點,即失去對 Google 服務(wù)器云的訪問權(quán)限是最小的問題.
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.
推薦答案
優(yōu)點:它可能已經(jīng)緩存在用戶的系統(tǒng)上.谷歌有很大的管道.您無需為帶寬付費.
Pros: It may already be cached on the user's system. Google has big pipes. You don't pay for the bandwidth.
缺點:您現(xiàn)在有兩種不同的方式使您的網(wǎng)站變得不可用:您的服務(wù)器上的服務(wù)中斷或 Google 的服務(wù)器上的一種中斷.
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.
這篇關(guān)于我應(yīng)該鏈接到 Google API 的 JS 庫云嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!