要求頻率
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本文件適用於下列方法:
Update API (v4):
fullHashes.find
Update API (v4):
threatListUpdates.fetch
更新要求
為避免伺服器過載,同時享有最佳防護效果,Update API (v4) 將
用戶端可將要求傳送至安全瀏覽伺服器的頻率時間間隔
執行網址檢查
(fullHashes.find)
或更新本機資料庫
(threatListUpdates.fetch).
資料的初始要求必須在 0 到 1 分鐘的
啟動或喚醒用戶端。後續要求只有在
最短等待時間,或
已設下輪詢模式時間限制
。
最短等待時間長度
兩者
fullHashes.find response 和
threatListUpdates.fetch 回應
用戶端必須遵循 minimumWaitDuration
欄位。
如果回應中的 minimumWaitDuration
欄位未設定,用戶端可以
彈性更新,且可視需要一次傳送最多的 threatListUpdates
或 fullHashes
要求
他們的資料。
如果回應中的 minimumWaitDuration
欄位「已設定」,用戶端就無法
更新的頻率會高於等待時間長度。舉例來說,如果回應 fullHashes
回應
包含最短等待時間為 1 小時,用戶端不得傳送任何 fullHashes
要求
直到該小時結束為止。就算使用者造訪的網址雜湊前置字元與本機相符
資料庫請注意,用戶端更新的頻率可以低於最短等待時間
可能會使防護功能受到負面影響)。
輪詢模式
自動輪詢會同時套用至
fullHashes.find response 和
threatListUpdates.fetch 回應。
接收失敗 HTTP 回應的用戶端 (也就是說,
200 OK
) 必須進入輪詢模式。進入輪詢模式後,用戶端必須等待運算時間
才能再次向伺服器發出要求
用戶端必須使用以下公式計算輪詢持續時間:
MIN((2N-1 * 15 minutes) * (RAND + 1), 24 hours)
N 代表用戶端遇到的連續失敗要求數量
(在第一個失敗的請求後從 N=1 開始)。RAND 是介於 0 到 1 之間的隨機數字
必須在每次成功更新後選取
用戶端收到成功的 HTTP 回應後,必須結束輪詢模式,並遵循
最短等待時間
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThe Google Safe Browsing Update API (v4) enforces request frequency limits to prevent server overload and maintain optimal protection.\u003c/p\u003e\n"],["\u003cp\u003eClients should adhere to the \u003ccode\u003eminimumWaitDuration\u003c/code\u003e field provided in API responses to determine update frequency.\u003c/p\u003e\n"],["\u003cp\u003eIf the \u003ccode\u003eminimumWaitDuration\u003c/code\u003e field is not set, clients can update as frequently as needed; if set, updates should not exceed the specified duration.\u003c/p\u003e\n"],["\u003cp\u003eUpon receiving unsuccessful HTTP responses, clients must enter back-off mode, delaying subsequent requests using a calculated time duration formula.\u003c/p\u003e\n"],["\u003cp\u003eAfter a successful response, clients exit back-off mode and resume following the \u003ccode\u003eminimumWaitDuration\u003c/code\u003e guidelines for updates.\u003c/p\u003e\n"]]],["The Update API v4's `fullHashes.find` and `threatListUpdates.fetch` methods require clients to adhere to request time intervals. Initial requests must be sent within 0-1 minutes of startup, and subsequent requests must observe the `minimumWaitDuration` or `back-off mode`. If `minimumWaitDuration` isn't set, clients can update freely; if set, they must wait for the specified duration. Unsuccessful HTTP responses trigger back-off mode, using a formula to determine the wait time, until a successful response occurs.\n"],null,["# Request Frequency\n\nThis document applies to the following methods:\n- [Update API (v4)](/safe-browsing/v4/update-api): [fullHashes.find](/safe-browsing/v4/update-api#example-fullHashesfind)\n- [Update API (v4)](/safe-browsing/v4/update-api): [threatListUpdates.fetch](/safe-browsing/v4/update-api#example-threatListUpdatesfetch)\n\nUpdate requests\n---------------\n\n- To prevent server overload and to benefit from optimal protection, the Update API (v4) imposes time intervals for how often a client can send requests to the Safe Browsing server to perform URL checks ([fullHashes.find](/safe-browsing/v4/update-api#example-fullhashesfind)) or to update the local database ([threatListUpdates.fetch](/safe-browsing/v4/update-api#example-threatlistupdatesfetch)).\n- The initial request for data must happen at a random interval between 0 and 1 minutes after the client starts or wakes up. Subsequent requests can happen only after the [minimum wait duration](/safe-browsing/v4/request-frequency#minimum-wait-duration) or [back-off mode](/safe-browsing/v4/request-frequency#back-off-mode) time limit has been observed.\n\nMinimum wait duration\n---------------------\n\n- Both the [fullHashes.find response](/safe-browsing/v4/update-api#http-post-response_2) and [threatListUpdates.fetch response](/safe-browsing/v4/update-api#http-post-response) have a `minimumWaitDuration` field that clients must obey.\n- If the `minimumWaitDuration` field **is not set** in the response, clients can update as frequently as they want and send as many `threatListUpdates` or `fullHashes` requests as they want.\n- If the `minimumWaitDuration` field **is set** in the response, clients cannot update more frequently than the length of the wait duration. For example, if a `fullHashes` response contains a minimum wait duration of 1 hour, the client must not send send any `fullHashes` requests until that hour passes, even if the user is visiting a URL whose hash prefix matches the local database. (Note that clients can update less frequently than the minimum wait duration but this may negatively affect protection.)\n\nBack-off mode\n-------------\n\n- Automatic back-off applies to both the [fullHashes.find response](/safe-browsing/v4/update-api#http-post-response_2) and [threatListUpdates.fetch response](/safe-browsing/v4/update-api#http-post-response).\n- Clients that receive an unsuccessful HTTP response (that is, any HTTP status code other than `200 OK`) must enter back-off mode. Once in back-off mode, clients must wait the computed time duration before they can issue another request to the server.\n- Clients must use the following formula to compute the back-off time duration: \n\n```scdoc\nMIN((2N-1 * 15 minutes) * (RAND + 1), 24 hours)\n```\n- N corresponds to the number of consecutive, unsuccessful requests that the client experiences (starting with N=1 after the first unsuccessful request). RAND is a random number between 0 and 1 that needs to be picked after every unsuccessful update.\n- Once a client receives a successful HTTP response, the client must exit back-off mode and follow the [minimum wait duration](/safe-browsing/v4/request-frequency#minimum-wait-duration) specified above."]]