# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 1
# self = https://watcher.sour.is/conv/6eqnq2q
請求速率限制**
今天我們要討論的是如何對 API 進行限流。假設我們有一個 API,多個用戶在訪問它,我們總是有可能遇到某個用戶開始大量請求我們的服務,從而導致服務器超載,阻止其他用戶訪問該服務。這個用戶可能是一個惡意行爲者,試圖攻擊服務,或者只是由於某人的代碼中存在錯誤。但無論是哪種情況,我們都希望確保能夠消除這種情況的可能性。這種情況會導致其他用戶體驗差,並可能增加成本。因此,如果我們要防止某個特定用戶一次發 ⌘ Read more