Editing
Troubleshooting of HTTP errors in Mandarin
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 429 Too Many Requests == 原因: * 太頻繁地存取網站資源或網路服務 API 解決方案: * '''調整延遲時間''',根據您的使用模式和服務限制進行調整,例如:增加請求之間的延遲時間(例如在每個請求之間添加 1 秒的暫停)。 * 如果是存取網路服務 API,請閱讀文件以了解 API 的存取頻率限制 (Rate Limits),例如:(1)「每分鐘請求次數」(RPM, Requests Per Minute) 每分鐘你透過 API 可以發出的最大請求數量、或 (2)「日請求次數」(RPD, Requests Per Day) 每天你透過 API 可以發出的最大請求數量。確認是否可以向服務提供商申請提高額度限制。 * '''實作指數退避重試機制''':在應用程式中偵測使用限制錯誤(HTTP 429)。每次重試失敗時增加延遲時間(例如,2 秒、4 秒、8 秒)。持續重試直到請求成功或達到最大重試次數。 參考資料: * [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 429 Too Many Requests - HTTP | MDN]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information