Skip to content

Make it possible to host BlueMap on static web hosts with client decompression mode#815

Merged
TBlueF merged 3 commits into
BlueMap-Minecraft:masterfrom
fechan:fechan/static-load
Jul 9, 2026
Merged

Make it possible to host BlueMap on static web hosts with client decompression mode#815
TBlueF merged 3 commits into
BlueMap-Minecraft:masterfrom
fechan:fechan/static-load

Conversation

@fechan

@fechan fechan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What it does

This PR is intended to address #293 by allowing you to host the web directory generated by BlueMap on a static web host, such as Github Pages. This is achieved by modifying web/settings.json and adding "clientDecompression": true.

A Github Pages demo is currently available from the following links (though I may move it soon):

Implementation details

There are two places that request files that are stored gzipped at rest: textures.json and PRBMs. When clientDecompression is on, it will attempt to fetch <filename>.gz instead of the normal filename, using RevalidatingFileLoader. After settingRevalidatingFileLoader.setClientDecompression(true), the file loader will decompress the gzipped data using the browser-native Compression Streams API.

Possible issues

  • Client decompression will not work in the Vite preview environment (i.e. when you use npm run dev), since the decompression code errors out with Failed to read data from the ReadableStream: “TypeError: The input data is corrupted: incorrect header check”. This seems to be the same issue faced by these folks: Can't download mp3 when self-hosting via Docker monochrome-music/monochrome#320. However, this does not affect the production environment.

@fechan fechan marked this pull request as ready for review July 9, 2026 09:23

@TBlueF TBlueF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently in the process of rewriting the webapp, this feature is already implemented there.
But until that rewrite is done, i think it doesn't do any harm to merge this :)

@TBlueF TBlueF merged commit 0e95406 into BlueMap-Minecraft:master Jul 9, 2026
3 checks passed
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.

2 participants