Skip to content

Make compressed site friendly for hosted static sites. #293

Description

@yikerman

Is your feature request related to a problem? Please describe.
One of the benefits of static sites is it can be served through static site hosting providers. However when it comes to gzip compressed sites the wiki redirects the .json to .json.gz with a Content-Encoding:gzip http header. However not every (little) hosting providers have this kind of functionality.

Describe the solution you'd like
Instead of the full server side method, the client can have an idea about whether the site is compressed and fetch the gzips automatically.

Activity

  1. TBlueF commented on Feb 21, 2022

    @TBlueF
    Member

    This is (to my knowledge) not feasible:
    If the server doesn't send the Content-Encoding: gzip header, then the browser doesn't do the decompressing natively. Which would mean that the web-app needs to manually decompress the tiles through JavaScript. Which (i tried, and) is incredible slow.

  2. yikerman commented on Feb 21, 2022

    @yikerman
    Author

    What about pako? The benchmark indicates it’s only about 3 times slower than zlib itself.

  3. reopened this on Feb 21, 2022
  4. TBlueF commented on Feb 21, 2022

    @TBlueF
    Member

    I am not sure what i tried before, and if i tired it with pako .. i can put this somewhere in the TODO, but testing this will be very low prio. And will probably not happen in the near future (unless someone else PRs it)

  5. yikerman commented on Feb 21, 2022

    @yikerman
    Author

    I totally understand this. I’ve found an alt btw. Thanks for all the support.

  6. moved this from TODO to Distant Ideas / To be discussed in TODO / Idea boardon Jun 14, 2023
  7. ZacharyDuBois commented on Sep 15, 2023

    @ZacharyDuBois

    I feel this would be extremely nice to have. For example, S3 or B2 storage fronted with a CDN provider such as CloudFront, CDN77, or Bunny.net.

    But that also begs the other request, push direct to an external storage and don't maintain a local copy.

  8. fechan commented on Dec 8, 2025

    @fechan
    Contributor

    With the Compression Streams API (which has baseline/widely available support according to MDN), it should be possible to use the browser's native gzip decompression. If support for browsers older than 2023 is desired, then I hear wasm gzip libraries are faster than any pure JS implementation.

    In any case, I would find this feature very useful, and I might be interested in implementing it. I'm not too familiar with the BlueMap project structure, but I assume the implementation steps would be:

    • In TileLoader.js Detect if the server only sends compressed PRBMs (somehow?)
    • Instead of the Three.js FileLoader, fetch the *.prbm.gz ourselves and decompress
    • Parse the decompressed data with PRBMLoader() as normal

    Are there any other caveats to be aware of? Other non-PRBM files that need decompressing elsewhere?

  9. TBlueF commented on Dec 8, 2025

    @TBlueF
    Member

    @fechan
    The Compression Streams API is the way this should be implemented, yes 👍.
    However, the current plan is to first do a complete rewrite of the webapp which is already in-progress. After that, issues like this one would be adressed.

    If you still want to implement this into the old webapp (as i can make no guarantees on how long the rewrite will still take me), here are my thoughts:

    • In TileLoader.js Detect if the server only sends compressed PRBMs (somehow?)

    Instead of a detection i would prefer a simple setting in the webapps settings.json :)

    • Instead of the Three.js FileLoader, fetch the *.prbm.gz ourselves and decompress
    • Parse the decompressed data with PRBMLoader() as normal

    Sounds good

    Are there any other caveats to be aware of? Other non-PRBM files that need decompressing elsewhere?

    The maps/<map-id>/textures.json is stored compressed (textures.json.gz) as well in the latest versions. Other then that, i don't think there are any more caveats :)

  10. TBlueF commented on Aug 6, 2026

    @TBlueF
    Member

    Implemented with 0e95406.
    For now, manually edit the settings.json to include "clientDecompression": true to enable, there might be a setting in the actual bluemap configs later :)

  11. moved this from Distant Ideas / To be discussed to Ready for next release in TODO / Idea boardon Aug 6, 2026
  12. moved this from Ready for next release to Done in TODO / Idea boardon Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions