ความถี่ของคําขอ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เอกสารนี้ใช้กับวิธีการต่อไปนี้
อัปเดต API (v4):
fullHashes.find
อัปเดต API (v4):
threatListUpdates.fetch
อัปเดตคำขอ
อัปเดต API (v4) เพื่อป้องกันไม่ให้เซิร์ฟเวอร์ทำงานหนักเกินไปและเพื่อรับประโยชน์จากการป้องกันที่ดีที่สุด
ช่วงเวลาว่าไคลเอ็นต์สามารถส่งคำขอไปยังเซิร์ฟเวอร์ Google Safe Browsing ได้บ่อยเพียงใด
ตรวจสอบ URL
(fullHashes.find)
หรือเพื่ออัปเดตฐานข้อมูลในเครื่อง
(threatListUpdates.fetch).
คำขอข้อมูลเริ่มต้นต้องเกิดขึ้นแบบสุ่มช่วงเวลาระหว่าง 0 ถึง 1 นาทีหลังจาก
เครื่องเริ่มหรือตื่น คำขอที่ตามมาจะเกิดขึ้นหลังจาก
ระยะเวลารอขั้นต่ำหรือ
จำกัดเวลาการใช้โหมดย้อนกลับแล้ว
สังเกตการณ์แล้ว
ระยะเวลารอขั้นต่ำ
ทั้ง
fullHashes.find response และ
การตอบสนองของ threatListUpdates.fetch
มีฟิลด์ minimumWaitDuration
ที่ลูกค้าต้องปฏิบัติตาม
หากไม่ได้ตั้งค่าช่อง minimumWaitDuration
ในการตอบกลับ ไคลเอ็นต์จะทำสิ่งต่อไปนี้ได้
อัปเดตบ่อยเท่าที่ต้องการและส่งคำขอ threatListUpdates
หรือ fullHashes
ได้มากเท่าที่ต้องการ
ที่พวกเขาต้องการ
หากมีการตั้งค่าช่อง minimumWaitDuration
ในการตอบกลับ ไคลเอ็นต์จะทำสิ่งต่อไปนี้ไม่ได้
อัปเดตบ่อยกว่าระยะเวลาของการรอ เช่น หากคำตอบ fullHashes
มีระยะเวลารอขั้นต่ำ 1 ชั่วโมง ลูกค้าต้องไม่ส่งคำขอ fullHashes
ใดๆ
จนกว่าชั่วโมงนี้จะผ่านไป แม้ว่าผู้ใช้จะเข้าชม URL ที่มีส่วนนำหน้าแฮชตรงกับ URL ของเครื่อง
ฐานข้อมูล (โปรดทราบว่าไคลเอ็นต์จะอัปเดตได้น้อยกว่าระยะเวลาการรอขั้นต่ำ แต่การตั้งค่านี้
อาจส่งผลเสียต่อการป้องกัน)
โหมดย้อนกลับ
การสำรองข้อมูลอัตโนมัติมีผลกับ
fullHashes.find response และ
threatListUpdates.fetchการตอบกลับ
ไคลเอ็นต์ที่ได้รับการตอบสนอง HTTP ที่ไม่สำเร็จ (กล่าวคือ รหัสสถานะ HTTP อื่นๆ ที่นอกเหนือจาก
200 OK
) ต้องเข้าสู่โหมดแบ็คออฟ เมื่ออยู่ในโหมดย้อนกลับ ไคลเอ็นต์ต้องรอเวลาที่คำนวณ
ระยะเวลาก่อนที่จะส่งคำขอใหม่ไปยังเซิร์ฟเวอร์
ลูกค้าต้องใช้สูตรต่อไปนี้เพื่อคํานวณระยะเวลาย้อนกลับ
MIN((2N-1 * 15 minutes) * (RAND + 1), 24 hours)
N หมายถึงจำนวนคำขอที่ไม่สำเร็จต่อเนื่องซึ่งลูกค้าได้รับ
(ขึ้นต้นด้วย N=1 หลังจากคำขอแรกที่ไม่สำเร็จ) RAND เป็นเลขสุ่มที่มีค่าระหว่าง 0 ถึง 1
ซึ่งต้องเลือกหลังจากการอัปเดต
ที่ไม่สำเร็จทุกครั้ง
เมื่อไคลเอ็นต์ได้รับการตอบสนอง HTTP สำเร็จ ไคลเอ็นต์ต้องออกจากโหมด Back-off และปฏิบัติตาม
ระยะเวลารอขั้นต่ำ
ที่ระบุข้างต้น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\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."]]