Timeout limits for Vue Storefront commerce calls: what to consider?
0 reputation · 04 Apr 2020, 20:50 UTC
Goal
Gracefully handle request cancellations and timeouts when calling commerce backends through Vue Storefront’s SDK/middleware layer.
Constraints
Vue Storefront routes all storefront calls through a server‑side middleware that wraps an HTTP client (commonly axios). The timeout and cancellation behavior is therefore defined by the client configuration and the lifecycle of the component or page rendering. SSR responses can fail with 500 errors if a backend hangs, while client‑side navigation may leave stale requests unresolved if not aborted.
Unresolved Decision
The framework does not prescribe a single pattern for cancellation: developers can abort requests per composable, use Vue/Nuxt lifecycle hooks, or centralize it via an interceptor. Additionally, the exact keys for configuring per‑endpoint timeouts in the middleware configuration vary across Vue Storefront releases.
Specific Questions
- What configuration options exist to set a per‑endpoint timeout in Vue Storefront’s middleware layer?
- Should cancellation be handled centrally via an interceptor or left to each composable call site?
- How can we reliably detect that a request was aborted during SSR versus a genuine network failure?