Workers SDK Issue Reports

← Back to Dashboard

#9040 Miniflare cache refuses to store different status codes than the production environment

Recommendation:KEEP OPEN
Difficulty:n/a
Reasoning:

Confirmed parity bug: Miniflare uses http-cache-semantics which rejects 201 status codes that production cache accepts. Labeled `internal`, maintainer escalated internally June 2025. Reporter has workaround.

Suggested Action:

Follow up internally on production cache behavior documentation. Once available, implement fix.

Analysis Report

Issue Review: cloudflare/workers-sdk#9040

Summary

Miniflare cache uses http-cache-semantics to determine storability, rejecting status code 201 that Cloudflare's production cache accepts.

Findings

  • Created: 2025-04-24
  • Updated: 2025-12-17
  • Version: Wrangler v4.13.0 → v4.60.0 (current)
  • Component: Miniflare
  • Labels: bug, internal
  • Comments: 2

Key Evidence

  • Bug confirmed: The reporter provides a clear MWE showing caches.default.put() with a 201 response works in production but fails in local dev
  • Root cause identified: Miniflare uses http-cache-semantics library which follows RFC rules for cacheable status codes, but Cloudflare's production cache accepts different codes
  • Code unchanged: The cache.worker.ts still uses http-cache-semantics and the storable check - no fix has been applied
  • Internal dependency: Labeled internal - requires Cloudflare platform team to document production cache behavior
  • Maintainer engaged: petebacondarwin commented (2025-06-30) that they asked internally for production behavior documentation
  • Reporter has workaround: Using status code 200 instead of 201, waiting for documentation before submitting a PR
  • No merged PR: No PRs reference or fix this issue
  • No changelog entry: Issue #9040 not mentioned in miniflare CHANGELOG

Recommendation

Status: KEEP OPEN

Reasoning: This is a confirmed parity bug between Miniflare and production. The issue is blocked on internal Cloudflare documentation about which status codes the production cache accepts. A maintainer has already escalated internally but there's been no update since June 2025.

Action: Follow up internally on the status of the production cache behavior documentation. Once that's available, either the reporter or a maintainer can implement the fix.

Suggested Comment

Hi! Checking in on this issue - it's been about 6 months since the internal request for production cache behavior documentation was made. Is there any update on what status codes the production cache accepts? Once we have that information, this should be a straightforward fix.

Notes & Feedback (0)

No notes yet.

Add Note