Skip to content

fix(maps): bypass CF edge cache for OFM proxy + tile probe diagnostic - #180

Merged
slaveofcode merged 6 commits into
developfrom
fix/ofm-bypass-edge-cache
Aug 8, 2026
Merged

fix(maps): bypass CF edge cache for OFM proxy + tile probe diagnostic#180
slaveofcode merged 6 commits into
developfrom
fix/ofm-bypass-edge-cache

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Root cause

The Worker's OFM proxy used cf: { cacheEverything: true, cacheTtl: 86400 } on its upstream fetch. This caused Cloudflare's Singapore edge to serve cached responses for tiles.openfreemap.org/planet/.../*.pbf — the same corrupted edge cache entries that were breaking tile loading for Southeast Asia users in the first place.

ne2_shaded PNG tiles worked because those cache entries happened to be clean (or absent). Vector PBF tiles had corrupted cached responses at that edge node, coming back as HTTP 200 with wrong body content, which MapLibre silently retried forever.

Fix

  • Remove cf: { cacheEverything } from the Worker's OFM fetch so it goes directly to OFM origin via CF backbone, bypassing the stale edge cache.
  • Add a one-shot tile probe in MapExplorer.tsx that logs status/content-type/size/first-8-bytes so the next test immediately shows whether PBF tiles are valid.

🤖 Generated with Claude Code

slaveofcode and others added 6 commits August 8, 2026 13:27
Promote to production: map explorer tile loading diagnostics
Promote to production: fix blank map tiles via OFM proxy
Promote to production: absolute OFM proxy URLs
Promote to production: Clipboard Inspector tool
Promote to production: transformRequest OFM proxy fix
…stic

The Worker was fetching OFM tile URLs with cf:{cacheEverything:true}, which
caused it to serve corrupted responses cached by Cloudflare's Singapore edge
node (HTTP 200 but invalid PBF body). Removing cacheEverything forces the
Worker to fetch direct from OFM origin via CF backbone, skipping the stale
edge cache entries.

Also adds a one-shot tile probe in MapExplorer that logs the status, content-
type, size, and first 8 bytes of a sample tile — so the next test immediately
reveals whether the response is valid PBF or corrupted data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@slaveofcode
slaveofcode merged commit 002e3ec into develop Aug 8, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the fix/ofm-bypass-edge-cache branch August 8, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant