【After Winning Majority in LegCo: Beijing's Crackdown May Trigger International Intervention】
***感謝Hong Kong Columns - Translated,將我早前撰寫『議會過半想像:以「#國際攬炒」反制「臨立會2.0」』長文(https://www.facebook.com/joshuawongchifung/photos/a.313299448762570/2887650867994069/)翻譯成英文,鼓勵國際社會關注立會選舉一旦過半的沙盤推演,在最惡劣形勢下的制衡策略。***
中文精簡版本:https://www.facebook.com/joshuawongchifung/photos/a.564294826996363/2888641404561682/
Hongkongers have experienced our revolution for over half a year. They no longer take a consequentialist view to the effectiveness of their movement as they did years ago, or waste time second-guessing the intentions and background of fellow activists. Following the defensive battles at CUHK and PolyU, November’s District Council election saw a great victory of unity. More marvellous is the union between peaceful and “valiant” protesters.
In the process of resisting tyranny, the people have realised that one cannot prioritize one strategy over another. This is also how the common goal of “35+” came into being—the hope that we will win over half of the seats in the Legislative Council (LegCo) this September, such that the political spectrum that represents the majority of Hongkongers is able to gain control of legislative decisions. The political clout of Hongkongers will increase if 35 or more seats are successfully secured on our side. It is certainly one vital step to achieve the five demands within the system.
The possibility of realizing legislative majority
Technically it is not unrealistic to win a majority even under the current undemocratic system. Back in the 2016 LegCo election, we already won 30 seats. In addition to the District Council (First) functional constituency seat that is already in the pocket of the pan-democrats, as long as the candidates in Kowloon East and New Territories West do not start infighting again, we could safely secure 33 seats based on the number of pan-dem votes in 2016.
The other 3 seats required to achieve a majority depend on democrats’ breakthrough among the functional constituencies by dispersing the resources of the Liaison Office. They also count on whether the turnout this September could exceed 71.2% — that of last year’s District Council elections. Some of the factors that could affect the turnout include: will the epidemic persist into the summer? Will there be potential violent repression of protests in the 2 weeks preceding the election? Will Hong Kong-US relations be affected by the downturn of the global economy?
Therefore, the ambition of “35+” is to be prioritised by the resistance as both a means and an end. I have already expressed my support for an intra-party primary at the coordination meeting. In the meantime, it is pleasing to see the ongoing debates reaching a consensus of maximising the seats among geographical constituencies in the upcoming election.
Whilst enthusiastic coordination, we should also assess the post-election landscape and gauge Beijing’s reactions: if we do not reach 35 seats, Hong Kong will be subject to tighter control and more severe repression by China; but if the democratic parties successfully form a majority in LegCo, CCP’s fears of a “constitutional crisis” would become imminent. Hence, the key questions are how the Pan-Democrats should deal with the volatile political situation in Hong Kong and how they are going to meet Beijing’s charge head-on.
Watching out for Beijing’s dismissal of LegCo after reaching majority
To take back control of LegCo such that it faithfully reflects the majority’s principles and needs is the definition of a healthy democracy. Recently, however, DAB’s Tam Yiu-chung has warned that the plan of the Pan-Dems to “usurp power” in the LegCo would only lead to Beijing’s forceful disqualification of certain members or the interpretation of the Basic Law. This proves that winning a majority in LegCo is not only a popular conception but also a realistic challenge that would get on the nerves of Beijing. Could Beijing accept a President James To in LegCo? These unknown variables must be addressed upon achieving a majority.
While there is no telltale sign as to Beijing’s exact strategy, we are already familiar with the way CCP manipulated the Basic Law in the past 4 years. Having experienced three waves of disqualifications in LegCo, twice kicked out of LegCo with my team, and thrice locked up in jail, I have no false hopes of an easy compromise from Beijing: they would not let Pan-Dems control LegCo for half a year and wait (as is the proper procedure) until after having negatived the Budget to dissolve the legislature, and thereby giving them an easy victory in the re-elections. The greater the Pan-Dems threaten Beijing’s rule in Hong Kong, the more likely that it will trigger Beijing’s repression.
Since the disqualification and arrest of lawmakers have already become “normalised”, one can even imagine the police stepping into the LegCo building to force Pan-Dems into voting. Neither is it beyond our imagination to expect the CCP to kick out all 70 lawmakers in a fit of rage and replace them with a provisional LegCo “2.0” [HKCT note: The first was from 25 Jan 1997 to 30 Jun 1998]. To depend on a majority that could lead to a chapter of a “new testament” for One Country, Two Systems is perhaps what many elites long for, but they are overly optimistic:for a ticket to the promised land will not be available at the Chief Executive election campaign a year and a half later.
Admittedly, the Pan-Dems cannot unilaterally initiate “Laam-chaau” [HKCT note: mostly translated into “scorched-earth” mentality or “mutual destruction”; some even translated into “If I burn, you burn with us”]. The most they can do is to force a standstill of the government, and not for long the LegCo will have been eliminated from the equation to make the wheels turn again. It all leaves the plan of “Negativing the motion → Dissolving LegCo → Re-election after re-election → the stepping down of Carrie Lam” merely as overly positive speculation, probably resulting from their overestimate of CCP's capacity for rational calculation. The Pan-Dems must guard their frontlines and recognise what the biggest threat from Hong Kong to China could be. In this case, should LegCo sessions be disrupted or suspended, the Pan-Dems would have to be well prepared to surmount the expected obstacles and prevent the disqualification crisis 4 years ago—a Catch-22 indeed.
Productive tension from global intervention: Using Laam-chaau against the CCP
What aggravates the CCP the most is the potential threat to Hong Kong’s unique status as the one and only “separate customs territory”. Any miscalculation will compromise its role as the Chinese economy’s “white gloves”. Imagine if CCP were to disqualify all 70 elected lawmakers and convene a meeting north of the Shenzhen River to pass a resolution to Hong Kong’s affairs (much like the Provisional Legislative Council “1.0" in 1997), how great will the shock be in a world with an effective Hong Kong Human Rights and Democracy Act? However hard it is to predict the future one thing is certain: With the US presidential election just around the corner, blows to the separation of powers would not be tolerated, and the West would necessarily effect countermeasures against the Hong Kong government.
Beijing has been relying upon Hong Kong to navigate the international community for decades. While clamping down on the political freedom of the cosmopolitan city, Beijing desires to maintain the financial centre’s economic freedom. Hence, we started lobbying for the Hong Kong Human Rights and Democracy Act four years ago, and today we are determined to promote “Laam-chaau” on an international scale.
The will of the voters must be reflected in an election. If a “35+” legislature were to be dismissed and replaced, such flagrant violation of democracy would assuredly cause a greater backlash than the infamous extradition bill. Knowing what the reality ahead of us could be, we have to combine our election and international strategies to oppose the placement of a 35+ LegCo with an “Emergency Legislative Council 2.0”, to advance an international “Laam-chaau” to Hong Kong’s status as “separate customs territory”. Only then will we stand a chance to resist the regime and to realise the five demands.
Adjusting our mindset: Overcoming the “constitutional crisis” to reach a resolution
Upon the realization of the “35+” LegCo, it is expected that the CCP will launch a devastating counterattack. The Pan-Dems should not expect LegCo to run normally; neither can the lawmakers realise their governing blueprints they have for Hong Kong. Rather, candidates will be able to compete against one another with visions of a liberated Hong Kong through popular vote. Bringing this point up has nothing to do with undermining the common goal of reaching a majority in LegCo, but rather channels the battle of LegCo to positive use upon the rule of law’s death and a “constitutional crisis” ahead. Knowing that Hongkongers have nothing to fall back on, all Pan-Dems should not miss the only way to the realization of “35+”.
Thus, be they partisans, nonpartisans, incumbent politicians, amateur politicians, or the civil society as a whole – if we stay in the political discourse of 2016 and continue to perpetuate old stereotypes, that is to deal with the divisions on the pan-democratic camp by favouring the most “local” faction; to consider only resource allocation and self-aggrandizement as the purpose of a LegCo campaign; to ignore how potential lawmakers are fitted to what specific roles; to turn a blind eye to the journey of resistance since last summer (extending indefinitely into the future)—They would lead as astray and cost us lose a precious opportunity for change by winning a 35+ majority.
The extent to which the pan-democrats can stay united in light of the political atmosphere since last summer is another problem that our side must to address. Before the watershed moment of 12th June 2019, many democratic delegates were trapped in the mentality of needing to “preserve people’s livelihood”, “be content of what we have accomplished”, and other strategies that favours stability. As the government refuses to heed to the five demands, whether the democrats, especially those in the functional constituencies, have the political will to go all-in is the real difficult question that confronts us in the upcoming LegCo election.
All in all, if “35+” cannot be realised, it is unsurprising to see LegCo being more heavily suppressed in the next 4 years; even if "35+" is achieved, it is questionable whether the pan-democrats are able to weather multiple attacks, verbal or physical, from the regime (judging from its power in the last four years) and utilise the international Laam-chaau strategy against the displacement of LegCo. Adhering to the motto of “we fight on, each in his own way”, I can only hope that Hongkongers in elections, street confrontations and international front can reconcile with each other, so that we may collectively compel the government to yield to our demands in the next six months. It is only by reaching a resolution before a real constitutional crisis that we can combat the institutional violence of the regime and not be devoured by it.
https://hkcolumn.blogspot.com/2020/04/joshua-wong-after-winning-majority-in.html?fbclid=IwAR216gf53pG_j9JOpDfr2GItvjLfrFSekKTPzoEs3-s9KBqvPEwz865P8vw
「resource allocation中文」的推薦目錄:
- 關於resource allocation中文 在 黃之鋒 Joshua Wong Facebook 的最讚貼文
- 關於resource allocation中文 在 CommonWealth Magazine Facebook 的精選貼文
- 關於resource allocation中文 在 保衛香港自由聯盟- 政府突然改變「資源分配工作 ... - Facebook 的評價
- 關於resource allocation中文 在 YouTube Data API Overview - Google for Developers 的評價
- 關於resource allocation中文 在 5 Best Methods Of Successful Resource Allocation - YouTube 的評價
resource allocation中文 在 CommonWealth Magazine Facebook 的精選貼文
【Altering Mindset】
Chang-Tai Hsieh, Professor of Economics at the The University of Chicago Booth School of Business and the youngest economic academician in Academia Sinica, discussed with CommonWealth Magazine about how Taiwan can break free from its current economic predicament.
中研院最年輕的經濟院士、芝加哥大學商學院講座教授謝長泰,以敏銳的觀察力、簡明易解的語言,談台灣經濟突圍的關鍵。
● Click the 'EN-CH' icon to read the article in Chinese.
● 點選' EN-CH ' 按鈕,閱讀本文中文版
#economy #development #innovation #resource #wage #allocation #mindset #Taiwan
resource allocation中文 在 YouTube Data API Overview - Google for 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)
... <看更多>
resource allocation中文 在 5 Best Methods Of Successful Resource Allocation - YouTube 的推薦與評價
![影片讀取中](/images/youtube.png)
Wouldn't you prefer a strategic resource allocation plan over a situational one? The key is to ensure every resource is accounted for and ... ... <看更多>
resource allocation中文 在 保衛香港自由聯盟- 政府突然改變「資源分配工作 ... - Facebook 的推薦與評價
政府突然改變「資源分配工作」(Resource Allocation... ... <看更多>