fix(maps): bypass CF edge cache for OFM proxy + tile probe diagnostic - #180
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fortiles.openfreemap.org/planet/.../*.pbf— the same corrupted edge cache entries that were breaking tile loading for Southeast Asia users in the first place.ne2_shadedPNG 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
cf: { cacheEverything }from the Worker's OFM fetch so it goes directly to OFM origin via CF backbone, bypassing the stale edge cache.🤖 Generated with Claude Code