You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub pages hosting .pmtiles not always working? (Chrome/Firefox) #584
Originally posted by jamaps June 15, 2025
Hi y'all
I've been using GitHub pages to host smaller .pmtiles (<50mb or so) for the past few months (and mostly loading and styling them in maplibre). Has been working great!
But recently I'm seeing that .pmtiles files hosted via Github pages are sometimes not loading and returning errors like this in my web browser:
In Chrome, Error: Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.
In Firefox, "Decoding failed."
My projects still work perfectly fine when testing locally and loading local files, or when loading .pmtiles coming from anywhere else other than a GitHub repo.
Anyone know if GitHub pages has changed how they serve .pmtiles or similar files that rely on range requests? or have any other ideas?
(Noticing as well that Chrome seems to not error as much compared to Firefox, but I don't really understand why there would a browser difference).
Thanks!
~ Jeff
Reacted by Hannah Recht, Ko Nagase, Hidenori, Arjun Verma and Petteri Vaarala
Other browsers such as Safari and Chrome only send Accept-Encoding: identity.
Something recently changed in GitHub Page's Fastly CDN configuration meaning that the server responds with an Content-Encoding: gzip on 206 responses if gzip is present in Accept-Encoding. This means no PMTiles hosted on GitHub Pages will work in Firefox.
Because we cannot control Accept-Encoding in the client, the only fix I see is to prove that the new GitHub pages behavior is incorrect. I think the best approach may to be make a very minimal reproduction of the problem using raw fetch requests and no PMTiles at all.
@Robinlovelace@jamaps a temporary workaround to fix on Firefox is to rename .pmtiles to .pmtiles.gz. That will stop GitHub Pages from applying automatic compression.
From testing https://bdon.github.io/ghpages-firefox-range-bug/ this issue has been fixed recently in GitHub Pages, so a .pmtiles.gzworkaround is no longer needed. If others can confirm their existing repos are fixed, I'll close out this issue.
Reacted by TANG ZhiXiong (@dvorak4tzx) and Jeff Allen
Activity
bdon commentedon Jul 1, 2025
This is the line that fails:
https://github.com/protomaps/PMTiles/blob/main/js/src/index.ts#L460
Something changed in the GitHub Pages HTTP implementation related to
Content-Encodingbdon commentedon Jul 1, 2025
https://github.com/orgs/community/discussions/162857 may also be related
bdon commentedon Jul 8, 2025
Here is my current understanding of the problem:
Firefox is unique in that it sends the following HTTP header along with
Range:Other browsers such as Safari and Chrome only send
Accept-Encoding: identity.Something recently changed in GitHub Page's Fastly CDN configuration meaning that the server responds with an
Content-Encoding: gzipon 206 responses if gzip is present inAccept-Encoding. This means no PMTiles hosted on GitHub Pages will work in Firefox.Because we cannot control
Accept-Encodingin the client, the only fix I see is to prove that the new GitHub pages behavior is incorrect. I think the best approach may to be make a very minimal reproduction of the problem using raw fetch requests and no PMTiles at all.bdon commentedon Jul 9, 2025
I have created an independent reproduction of the issue here:
https://github.com/bdon/ghpages-firefox-range-bug
@jamaps
Robinlovelace commentedon Jul 29, 2025
Great to see this issue, here's a larger reproducible example: https://pctni.github.io/uitest/
Result on Firefox (with debugging FYI):
On Chrome, all fine:
Robinlovelace commentedon Jul 29, 2025
Will try deploying on Netlify.
Robinlovelace commentedon Jul 29, 2025
When served by netlify the same codebase renders fine on Firefox: https://pctnitest.netlify.app/
bdon commentedon Aug 4, 2025
@Robinlovelace @jamaps a temporary workaround to fix on Firefox is to rename
.pmtilesto.pmtiles.gz. That will stop GitHub Pages from applying automatic compression.In this long term I am hoping to get this merged into the MIME type database Pages uses, which ought to fix the problem: https://github.com/jshttp/mime-db/pull/398/files
jamaps commentedon Aug 13, 2025
@bdon thank you! the workaround is working for me - hopefully that PR gets merged in soon
Trying to apply workaround for github pages not serving pmtiles
Workaround GitHub Pages/Firefox PMTiles bug
fix(data): use .gz suffix for PMTiles to avoid CDN compression issues
bdon commentedon Mar 13, 2026
From testing https://bdon.github.io/ghpages-firefox-range-bug/ this issue has been fixed recently in GitHub Pages, so a
.pmtiles.gzworkaround is no longer needed. If others can confirm their existing repos are fixed, I'll close out this issue.Fix Firefox "Decoding failed" on GitHub Pages by bypassing Range-requ…
Revert "work around gzip/firefox bug in GH pages"
Update cloud-storage.md
Update cloud-storage.md (#133)