http://www.evanlin.com/gorilla-facebook-tsdb/
[中文導讀] Facebook 的時間序列資料庫 - Gorilla (Gorilla: A Fast, Scalable, In-Memory Time Series Database) 包括 Go code 解析.
Facebook 在之前發表了他們的時間序列資料庫論文 "Gorilla: A Fast, Scalable, In-Memory Time Series Database" http://www.vldb.org/pvldb/vol8/p1816-teller.pdf
具有 12 倍以上的有效的資料壓縮,並且透過 In-memory time-series database 的方式.可以讓資料存取的 Query Latency 減少 73 倍.
透過一個很棒的網站 "Morning Paper" 的導讀 https://blog.acolyer.org/…/gorilla-a-fast-scalable-in-memo…/
加上很棒的範例程式碼(Golang): https://github.com/dgryski/go-tsz
我還是稍微整理了一下壓縮演算法的概念,並且寫成中文導讀,希望有興趣的人可以來一起討論.
latency中文 在 Eric's English Lounge Facebook 的最讚貼文
[托福和雅思單字表+mp3] Human Biology and Health care
Audio file: https://www.dropbox.com/s/82yk91rhvzwswl2/HBH.mp3
老師這次花了很多時間幫大家整理了 human biology and health care 的單字,為了讓同學不會聽到睡著,老師融入了很多音效...但是建議不要晚上的時候聽,免得被嚇到喔!
老師雖然每次在提供單字表時都會附上中文解釋,但這只是方便學生更快知道這個單字最通用的意思,不代表是它最完整的涵義及用法。除此之外,有心的同學應該進一步使用其它工具查詢,最好是單字,配詞與句子一起背 (死背一個單字是無用的),再透過經常使用單字的方式,加強自己對單字的認知和應用。當然,你也可以利用老師或字典提供的單字音檔,進而增加自己對單字的辨識能力和發音!
Use the audio file to improve your pronunciation of these words. The file can also be used as a simple listening and spelling test! Further, like I said many times in class, you must learn in context! Do not just learn the vocabulary words and collocation. You must also construct sentences, read articles suitable for your level on the given topic, and then use the new words and phrases in writing. The accumulation of background knowledge is also essential. Always learn in meaningful context!!!
Human Biology and Health care
abdomen (n.) 腹部
absorb (v.) 吸收
abstain (v.) 避免
abuse (v.) 濫用
accident (n.) 意外
ache (n.) (持續性地)疼痛
admit (v.) 准許進入; (be admitted to a hospital 送入醫院 )
airway (n.) (肺的) 氣道、氣管
allergy (n.) 過敏
allergic (adj.) 過敏的
alternative medicine (n.) 另類醫療
ambulance (n.) 救護車
amputate (v.) 截斷; 截肢
anesthesia 麻醉
ankle (n.) 腳踝
antibiotics (n.) 抗生素(複數)
appendix (n.) 盲腸
artery (n.) 動脈
bacterium (n./pl.=bacteria) 細菌
balanced (a.) 均衡
bandage (n.) 繃帶
benign (a.) 良性的
beware (v.) 注意
biohazard (n.) 生物性危害
biological (a.) 生物的
biology (n.) 生物學
blood (n.) 血液
blood pressure (n.) 血壓
blood vessel (n.) 血管
body (n.) 身體
bowel (n.) 腸
breathe (v.) 呼吸
bruise (n.) 青腫
calorie (n.) 卡路里(熱量單位)
cancer (n.) 癌
carbohydrate (n.) 醣類
cardiovascular diseases (n.) 心臟血管疾病
care (n.) 照顧
carrier (n.) 帶茵者;病媒
cast (n.) 石膏
cell (n.) 細胞
cell division (phr.) 細胞分裂
chicken pox (n.) 水痘
chiropractor (n.) 脊骨神經醫師; 按摩醫生
cholesterol (n.) 膽固醇
circulation (n.) 循環
clinic (n.) 診所
clone (n. / v.) 複製
cold (n.) 感冒 (I caught a cold.)
colon (n.) 結腸
condition (n.) 狀況
conscious (adj.) 有意識的
contagious (a.) 有感染性的
cough (v./n.) 咳嗽
cough syrup (n.) 止咳糖漿
CPR (n.) 心肺復甦術
critical (a.) 關鍵的
crutches (n.) 柺杖,
cultivation of bacteria (phr.) 細菌培養
cure (v./n.) 治癒 ; 療法
deform (v.) 變形
dentist (n.) 牙醫
dermatology (n.) 皮膚科
deteriorate (v.) 惡化
diabetes (n.) 糖尿病
diabetic (a.) (患) 糖尿病 (n.) 指糖尿病患者
diet (n.) 飲食
diet (v.) (以治療、減肥為目的的) 節食
digestive system (n.) 消化系統
DNA (n.) 脫氧核糖核酸 drug (n.) 藥品;毒品 egg (n.) 蛋
embryo (n./adj.= embryonic) 胎兒
emergency medical kit (n.) 應急醫療包
emergency room (n.) 急診室
emotion (n.) 情感
excrete (v.) 排泄
fertilize (v.) 【生物】授精
fever (n.) 發燒
flu/influenza (n.) 流行性感冒
gene (n.) 基因
genetically engineered (phr.) 基因修改, 製造
genetically modified (phr.) 基因修改
glucose (n.) 葡萄糖
hallucination (n.) 幻覺
heal (v.) (傷口)癒合; 痊癒
health (n.) 保健
hemoglobin (n.) 血紅素
hereditary (a.) 遺傳的
high blood pressure (n.) 高血壓
hormone (n.) 荷爾蒙
hospital (n.) 醫院
hospitalized (a.) 住院的
ill (a.) 生病的
illness (n.) 生病; 疾病
immune (a.) 免疫的
immune system (n.) 免疫系統
immunity (n.) 免疫
infect (v.) 傳染(疾病)
infection (n.) 傳染;感染
infectious (a.) 有傳染性的
inflammation (n.) 發炎
injection (n.) 注射
injury (n.) 受傷
inorganic (n.) 無機
instant (a.) 立即的
insurance (n.) 保險
intestines (n.)腸子
intoxicated (a.) 中毒
irregular (a.) 不平均的
itch (n.) 癢
IV drip (n.) 靜脈滴注
kidney (n.) 腎臟
knee (n.) 膝,膝蓋
lap (n.) 膝部
latency period (n.) 潛伏期
latent (a.) 潛伏的
lens (n.) 晶體
limb (n.) 肢
liver (n.) 肝臟
long-term effects (n.) 長期影響
lung (n.) 肺
malignant (n.) 惡性的
malnutrition (n.) 營養不良
mature (a.) 成熟的
medical treatment (n.) 醫學治療
mental health (n.) 心理健康
metabolism (n./v.=metabolize) 代謝
mineral (n.) 礦物
muscle (n.) 肌肉
nerve (n.) 神經
nurse (n.) 護士
nursing home (n.) 養老院
nutrition (n.) 營養
nutritionist (n.) 營養師
olfactory (n.) 嗅覺
operate (v.) 動手術, 開刀
organ donation (n.) 器官捐贈
organic (n.) 有機
osteoporosis (n.) 骨質疏鬆
over-the-counter (a.) 成藥
pain (n.) 疼痛
palm (n.) 手掌
pancreas (n.) 胰臟
paralyzed (a.) 癱瘓的
patient (n.) 病患
pediatrician (n.) 小兒科醫師
perspiration (n./ v.=perspire) 汗
pharmacist (n.) 藥劑師
pharmacy (n.) 藥局
physician (n.) 醫師
physiological (a.) 生理學的
pill (n.) 藥丸
polio (n.) 小兒麻痺
prescription (n.) 處方籤
prevention (n.) 預防; 預防方法
protein (n.) 蛋白質
psychiatrist (n.) 精神病醫師
psychiatrist / shrink (n.) 心理醫生
psychologist (n.) 心理學家
psychology (n.) 心理學
rash (n.) 疹 ; 疹子
reaction (n.) 反應
recovery (n.) 復原
red blood cells (hemoglobin) (n.) 紅血細胞
relationship (n.) 關係
relaxed (a.) 冷靜
reproductive organs (n.) 生殖器官
revive (v.) 復原
runny nose (n.) 流鼻涕
sanitary (a.) 衛生的
scar (n.) 疤; 傷痕
scrape (n.) 擦傷
serum (n.) 血清
short-term effects (n.) 短期影響
sick bed (n.) 病床
sinus (n.) 靜脈竇
skin (n.) 皮膚
smallpox (n.) 天花
sneeze (v.) 打噴嚏
social health (n.) 社交健康
sore (a.) 痛的; 疼痛發炎的
spine (n.) 脊椎
starch (n.) 澱粉
stem cells(n.) 幹細胞
sterilize (v.) 消毒
stomach (n.) 胃
stuffy nose (n.) 塞住的鼻子
suffer from (phr.) 受...之苦; 受...困擾
surgeon (n.) 外科醫生
surgery (n.) 手術
symptom (n.) 症狀
syndrome (n.) 症候群
tablet (n.) 藥片
test (n.) 檢驗
thermometer (n.) 溫度計
throat (n.) 喉嚨
tissue (n.) (動植物的) 組織
touch (v.) 接觸、觸摸
toxic (a.) 有毒的
transplantation (n.) 移植
treatment (n.) 治療
trunk (n.) 軀幹
tuberculosis (n.) 結核病
tumor (n.) 腫瘤
unwholesome (a.) 不衛生的;不健康的;有害身心的
uterus (n.) 子宮
vaccinate (v.) 打預防針 (inoculate with a vaccine, vaccinate against…)
vaccine (n.) 疫苗
vein (n.) 靜脈
virus (n.) 病毒
vision (n.) 視覺/視覺/視力
vitamin (n.) 維他命、維生素
weight loss (n.) 體重減輕
well (a.) 健康的
wheelchair (n.) 輪椅
white blood cells (n.) 白血細胞
Complete List 完整托福和雅思單字表+mp3: http://tinyurl.com/lk3fglc
學習單字的方式:
英文單字學習 I: https://www.dropbox.com/s/tq2ym9m3ihsbuy6/vocabI.pdf
英文單字學習 II: https://www.dropbox.com/s/eu51xclk7qxb211/vocabII.pdf
英文單字學習 III: https://www.dropbox.com/s/fsx6zx150c2q7so/vocabIII.pdf
Free Online Dictionaries 免費線上字典和辭典: http://tinyurl.com/kzctz56
latency中文 在 YouTube Data API Overview | Google Developers 的推薦與評價
Introduction
This document is intended for developers who want to write applications that interact with YouTube. It explains basic concepts of YouTube and of the API itself. It also provides an overview of the different functions that the API supports.
Before you startYou need a Google Account to access the Google API Console, request an API key, and register your application.
Create a project in the Google Developers Console and obtain authorization credentials so your application can submit API requests.
After creating your project, make sure the YouTube Data API is one of the services that your application is registered to use:
Go to the API Console and select the project that you just registered.
Visit the Enabled APIs page.
In the list of APIs, make sure the status is ON for the YouTube Data API v3.
If your application will use any API methods that require user authorization, read the authentication guide to learn how to implement OAuth 2.0 authorization.
Select a client library to simplify your API implementation.
Familiarize yourself with the core concepts of the JSON (JavaScript Object Notation) data format. JSON is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see json.org.
Resources and resource types
A resource is an individual data entity with a unique identifier. The table below describes the different types of resources that you can interact with using the API.
Resources
activity
Contains information about an action that a particular user has taken on the YouTube site. User actions that are reported in activity feeds include rating a video, sharing a video, marking a video as a favorite, and posting a channel bulletin, among others.
channel
Contains information about a single YouTube channel.
channelBanner
Identifies the URL to use to set a newly uploaded image as the banner image for a channel.
channelSection
Contains information about a set of videos that a channel has chosen to feature. For example, a section could feature a channel's latest uploads, most popular uploads, or videos from one or more playlists.
guideCategory
Identifies a category that YouTube associates with channels based on their content or other indicators, such as popularity. Guide categories seek to organize channels in a way that makes it easier for YouTube users to find the content they're looking for. While channels could be associated with one or more guide categories, they are not guaranteed to be in any guide categories.
i18nLanguage
Identifies an application language that the YouTube website supports. The application language can also be referred to as a UI language.
i18nRegion
Identifies a geographic area that a YouTube user can select as the preferred content region. The content region can also be referred to as a content locale.
playlist
Represents a single YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users.
playlistItem
Identifies a resource, such as a video, that is part of a playlist. The playlistItem resource also contains details that explain how the included resource is used in the playlist.
search result
Contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data.
subscription
Contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
thumbnail
Identifies thumbnail images associated with a resource.
video
Represents a single YouTube video.
videoCategory
Identifies a category that has been or could be associated with uploaded videos.
watermark
Identifies an image that displays during playbacks of a specified channel's videos. The channel owner can also specify a target channel to which the image links as well as timing details that determine when the watermark appears during video playbacks and then length of time it is visible.
Note that, in many cases, a resource contains references to other resources. For example, a playlistItem
resource's snippet.resourceId.videoId
property identifies a video resource that, in turn, contains complete information about the video. As another example, a search result contains either a videoId
, playlistId
, or channelId
property that identifies a particular video, playlist, or channel resource.
The following table shows the most common methods that the API supports. Some resources also support other methods that perform functions more specific to those resources. For example, the videos.rate
method associates a user rating with a video, and the thumbnails.set
method uploads a video thumbnail image to YouTube and associates it with a video.
Operations
list
Retrieves (
GET
) a list of zero or more resources.insert
Creates (
POST
) a new resource.update
Modifies (
PUT
) an existing resource to reflect data in your request.delete
Removes (
DELETE
) a specific resource.The API currently supports methods to list each of the supported resource types, and it supports write operations for many resources as well.
The table below identifies the operations that are supported for different types of resources. Operations that insert, update, or delete resources always require user authorization. In some cases, list
methods support both authorized and unauthorized requests, where unauthorized requests only retrieve public data while authorized requests can also retrieve information about or private to the currently authenticated user.
Supported Operations
list
insert
update
delete
activity
caption
channel
channelBanner
channelSection
comment
commentThread
guideCategory
i18nLanguage
i18nRegion
playlist
playlistItem
search result
subscription
thumbnail
video
videoCategory
watermark
Quota usage
The YouTube Data API uses a quota to ensure that developers use the service as intended and do not create applications that unfairly reduce service quality or limit access for others. All API requests, including invalid requests, incur at least a one-point quota cost. You can find the quota available to your application in the API Console.
Projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day, an amount sufficient for the overwhelming majority of our API users. Default quota, which is subject to change, helps us optimize quota allocations and scale our infrastructure in a way that is more meaningful to our API users. You can see your quota usage on the Quotas page in the API Console.
Note: If you reach the quota limit, you can request additional quota by
completing the Quota extension
request form for YouTube API Services.
Google calculates your quota usage by assigning a cost to each request. Different types of
operations have different quota costs. For example:
A read operation that retrieves a list of resources -- channels, videos, playlists -- usually
costs 1 unit.
A write operation that creates, updates, or deletes a resource usually has costs
50
units.A search request costs
100
units.A video upload costs
1600
units.The Quota costs for API requests table shows the
quota cost of each API method. With these rules in mind, you can estimate the number of requests
that your application could send per day without exceeding your quota.
The API allows, and actually requires, the retrieval of partial resources so that applications avoid transferring, parsing, and storing unneeded data. This approach also ensures that the API uses network, CPU, and memory resources more efficiently.
The API supports two request parameters, which are explained in the following sections, that enable you to identify the resource properties that should be included in API responses.
The part
parameter identifies groups of properties that should be returned for a resource.
The fields
parameter filters the API response to only return specific properties within the requested resource parts.
part
parameterThe part
parameter is a required parameter for any API request that retrieves or returns a resource. The parameter identifies one or more top-level (non-nested) resource properties that should be included in an API response. For example, a video
resource has the following parts:
snippet
contentDetails
fileDetails
player
processingDetails
recordingDetails
statistics
status
suggestions
topicDetails
All of these parts are objects that contain nested properties, and you can think of these objects as groups of metadata fields that the API server might (or might not) retrieve. As such, the part
parameter requires you to select the resource components that your application actually uses. This requirement serves two key purposes:
It reduces latency by preventing the API server from spending time retrieving metadata fields that your application doesn't use.
It reduces bandwidth usage by reducing (or eliminating) the amount of unnecessary data that your application might retrieve.
Over time, as resources add more parts, these benefits will only increase since your application will not be requesting newly introduced properties that it doesn't support.
How to use thefields
parameterThe fields
parameter filters the API response, which only contains the resource parts identified in the part
parameter value, so that the response only includes a specific set of fields. The fields
parameter lets you remove nested properties from an API response and thereby further reduce your bandwidth usage. (The part
parameter cannot be used to filter nested properties from a response.)
The following rules explain the supported syntax for the fields
parameter value, which is loosely based on XPath syntax:
Use a comma-separated list (fields=a,b
) to select multiple fields.
Use an asterisk (fields=*
) as a wildcard to identify all fields.
Use parentheses (fields=a(b,c)
) to specify a group of nested properties that will be included in the API response.
Use a forward slash (fields=a/b
) to identify a nested property.
In practice, these rules often allow several different fields
parameter values to retrieve the same API response. For example, if you want to retrieve the playlist item ID, title, and position for every item in a playlist, you could use any of the following values:
fields=items/id,playlistItems/snippet/title,playlistItems/snippet/position
fields=items(id,snippet/title,snippet/position)
fields=items(id,snippet(title,position))
Note: As with all query parameter values, the fields
parameter value must be URL encoded. For better readability, the examples in this document omit the encoding.
The examples below demonstrate how you can use the part
and fields
parameters to ensure that API responses only include the data that your application uses:
Example 1 returns a video resource that includes four parts as well as
kind
and etag
properties.Example 2 returns a video resource that includes two parts as well as
kind
and etag
properties.Example 3 returns a video resource that includes two parts but excludes
kind
and etag
properties.Example 4 returns a video resource that includes two parts but excludes
kind
and etag
as well as some nested properties in the resource's snippet
object.Example 1
URL: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY
&part=snippet,contentDetails,statistics,statusDescription: This example retrieves avideo
resource and identifies several
resource parts that should be included in the API response.API response:
{
"kind": "youtube#videoListResponse",
"etag": "\"UCBpFjp2h75_b92t44sqraUcyu0/sDAlsG9NGKfr6v5AlPZKSEZdtqA\"",
"videos": [
{
"id": "7lCDEYXw3mM",
"kind": "youtube#video",
"etag": "\"UCBpFjp2h75_b92t44sqraUcyu0/iYynQR8AtacsFUwWmrVaw4Smb_Q\"",
"snippet": {
"publishedAt": "2012-06-20T22:45:24.000Z",
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"title": "Google I/O 101: Q&A On Using Google APIs",
"description": "Antonio Fuentes speaks to us and takes questions on working with Google APIs and OAuth 2.0.",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/hqdefault.jpg"
}
},
"categoryId": "28"
},
"contentDetails": {
"duration": "PT15M51S",
"aspectRatio": "RATIO_16_9"
},
"statistics": {
"viewCount": "3057",
"likeCount": "25",
"dislikeCount": "0",
"favoriteCount": "17",
"commentCount": "12"
},
"status": {
"uploadStatus": "STATUS_PROCESSED",
"privacyStatus": "PRIVACY_PUBLIC"
}
}
]
}
Example 2
URL: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY
&part=snippet,statisticsDescription: This example modifies thepart
parameter value so that the
contentDetails
andstatus
properties are not included
in the response.API response:
{
"kind": "youtube#videoListResponse",
"etag": "\"UCBpFjp2h75_b92t44sqraUcyu0/sDAlsG9NGKfr6v5AlPZKSEZdtqA\"",
"videos": [
{
"id": "7lCDEYXw3mM",
"kind": "youtube#video",
"etag": "\"UCBpFjp2h75_b92t44sqraUcyu0/iYynQR8AtacsFUwWmrVaw4Smb_Q\"",
"snippet": {
"publishedAt": "2012-06-20T22:45:24.000Z",
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"title": "Google I/O 101: Q&A On Using Google APIs",
"description": "Antonio Fuentes speaks to us and takes questions on working with Google APIs and OAuth 2.0.",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/hqdefault.jpg"
}
},
"categoryId": "28"
},
"statistics": {
"viewCount": "3057",
"likeCount": "25",
"dislikeCount": "0",
"favoriteCount": "17",
"commentCount": "12"
}
}
]
}
Example 3
URL: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY
&part=snippet,statistics&fields=items(id,snippet,statistics)Description: This example adds thefields
parameter to remove all
kind
andetag
properties from the API response.API response:
{
"videos": [
{
"id": "7lCDEYXw3mM",
"snippet": {
"publishedAt": "2012-06-20T22:45:24.000Z",
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"title": "Google I/O 101: Q&A On Using Google APIs",
"description": "Antonio Fuentes speaks to us and takes questions on working with Google APIs and OAuth 2.0.",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/hqdefault.jpg"
}
},
"categoryId": "28"
},
"statistics": {
"viewCount": "3057",
"likeCount": "25",
"dislikeCount": "0",
"favoriteCount": "17",
"commentCount": "12"
}
}
]
}
Example 4
URL: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY
&fields=items(id,snippet(channelId,title,categoryId),statistics)&part=snippet,statisticsDescription: This example modifies thefields
parameter from example 3
so that in the API response, each video resource'ssnippet
object only includes thechannelId
,title
,
andcategoryId
properties.API response:
{
"videos": [
{
"id": "7lCDEYXw3mM",
"snippet": {
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"title": "Google I/O 101: Q&A On Using Google APIs",
"categoryId": "28"
},
"statistics": {
"viewCount": "3057",
"likeCount": "25",
"dislikeCount": "0",
"favoriteCount": "17",
"commentCount": "12"
}
}
]
}
Optimizing performance
Using ETags
ETags, a standard part of the HTTP protocol, allow applications to refer to a specific version of a particular API resource. The resource could be an entire feed or an item in that feed. This functionality supports the following use cases:
Caching and conditional retrieval – Your application can cache API resources and their ETags. Then, when your application requests a stored resource again, it specifies the ETag associated with that resource. If the resource has changed, the API returns the modified resource and the ETag associated with that version of the resource. If the resource has not changed, the API returns an HTTP 304 response (Not Modified
), which indicates that the resource has not changed. Your application can reduce latency and bandwidth usage by serving cached resources in this manner.
The client libraries for Google APIs differ in their support of ETags. For example, the JavaScript client library supports ETags via a whitelist for allowed request headers that includes If-Match
and If-None-Match
. The whitelist allows normal browser caching to occur so that if a resource's ETag has not changed, the resource can be served from the browser cache. The Obj-C client, on the other hand, does not support ETags.
Protecting against inadvertent overwrites of changes – ETags help to ensure that multiple API clients don't inadvertently overwrite each other's changes. When updating or deleting a resource, your application can specify the resource's ETag. If the ETag doesn't match the most recent version of that resource, then the API request fails.
Using ETags in your application provides several benefits:
The API responds more quickly to requests for cached but unchanged resources, yielding lower latency and lower bandwidth usage.Your application will not inadvertently overwrite changes to a resource that were made from another API client.
The Google APIs Client Library for JavaScript supports If-Match
and If-None-Match
HTTP request headers, thereby enabling ETags to work within the context of normal browser caching.
Using gzip
You can also reduce the bandwidth needed for each API response by enabling gzip compression. While your application will need additional CPU time to uncompress API responses, the benefit of consuming fewer network resources usually outweighs that cost.
To receive a gzip-encoded response you must do two things:
Set the Accept-Encoding
HTTP request header to gzip
.
Modify your user agent to contain the string gzip
.
The sample HTTP headers below demonstrate these requirements for enabling gzip compression:
Accept-Encoding: gzip
User-Agent: my program (gzip)
... <看更多>
latency中文 在 直播時的延遲現象- YouTube說明 的推薦與評價
中文 (繁體). català; dansk; Deutsch; English; English (United Kingdom); español; español (Latinoamérica); Filipino; français; hrvatski ... ... <看更多>