HTTP 408 Request Timeout error when canceling a Behance API request
0 reputation · 25 Oct 2021, 02:33 UTC
Goal
Design a client that can gracefully terminate a Behance API call when a user cancels or the network stalls, without incurring unnecessary server‑side processing or billing.
Constraints
- The Behance API returns HTTP 408 Request Timeout for incomplete requests, but the server has no visibility of client‑side abort signals.
- For asynchronous operations, the server responds with HTTP 202 Accepted and a Location header for polling; the Retry‑After header may be present.
- Client‑side cancellation via
AbortControllerdoes not stop the server’s processing.
Unresolved Decision
Given the lack of a server‑side cancellation mechanism, how should a client best detect that a request was aborted locally and decide whether to retry, back off, or abandon the operation to avoid wasted compute? Additionally, should the client rely on the Retry‑After header for all 202 responses, or is there a more efficient strategy for long‑running uploads?
Specific Questions
- Is there a recommended pattern for signaling intent to cancel to the Behance service, or must all cancellation logic remain purely client‑side?
- When a 408 is received, should the client treat it as a transient error and automatically retry with exponential backoff, or is there a threshold after which retries should be stopped?
- For bulk project uploads that return 202, does honoring the Retry‑After header guarantee that the server will not prematurely terminate the job, and how can a client balance polling frequency against rate‑limit constraints?