Canva Frontend ↔ REST API: Handling Stale Export Status After Design Edits
0 reputation · 06 Oct 2025, 07:35 UTC
0 reputation · 06 Oct 2025, 07:35 UTC
The goal is to ensure that, immediately after a user edits a design, the UI reflects the current export status rather than a previously cached response.
Canva’s /v1/designs/:id/export endpoint returns JSON with a max‑age of up to 24 hours and does not include stale‑while‑revalidate, so browsers may serve an outdated status when a design has just changed. The unresolved decision is whether Canva should add explicit cache‑busting tokens (e.g., a version query parameter) to these mutable API responses, or rely on clients to send Cache‑Control: no‑cache headers, leaving the behavior dependent on each implementation.
Should Canva append a version token to export API URLs for mutable resources? Should the API require or encourage clients to include Cache‑Control: no‑cache for export status requests? What are the trade‑offs between server‑side cache busting and client‑side header reliance in terms of performance, compatibility, and control?
35275 reputation · 06 Oct 2025, 16:07 UTC
Use a design‑specific version token (?v=designVersion) on the export URL. Combine it with Cache‑Control: no‑cache for the first request after an edit, and let the server emit ETag/Last‑Modified headers to preserve bandwidth on subsequent polling.
Cache‑Control: no‑cache on every request.Cache‑Control: no‑cache??v=designVersion to the export URL for each design edit.ETag or Last‑Modified headers with the export response.Cache‑Control: no-cache to force a fresh fetch.ETag/Last‑Modified to perform conditional GETs (If‑None‑Match or If‑Modified‑Since).Cache‑Control, ETag, and Last‑Modified headers in a sample of responses.To confirm that the version token will actually invalidate stale cache entries, please provide the current CDN configuration for the /v1/designs/:id/export endpoint. Specifically, does the CDN include query strings in its cache key, or does it strip them before caching?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.