Giter Site home page Giter Site logo

Comments (3)

ShadowSonata avatar ShadowSonata commented on June 11, 2024

I had this similar issue the other day (as I was using the tag latest for my testing and it automatically bumped to the latest version). I found out that the content-encoding has changed.

This is the response header in v0.11.6
image

And the response header in v0.13.0
image

If I force content-encoding to gzip by adding "Accept-Encoding" to my request, the response time and the data size come back to normal.
image

from martin.

nyurik avatar nyurik commented on June 11, 2024

@ShadowSonata I think that's the culprit. I switched the default serving compression from gzip to brotli encoding (when the browser supports both and has not set a preference of one over the other). As you can see from your own example, you gained 20% on the content size. But that 20% doesn't come from nowhere - Brotli takes longer to compress.

So there are two ways to fix this, and both in theory could be used:

  • add compression preference, e.g. a CLI param --preferred-encoding (gzip|brotli) and a similar global config file value. If the browser does not give different q values for br and gzip in the Accept-Encoding header, Martin will pick one over the other. By default, Chrome sets Accept-Encoding:gzip, deflate, br (default q=1.0 for all)
  • Martin tile cache contains pre-compressed values - i.e. the cache has the value as returned by the tile source. MBTiles usually stores gzipped tiles. Postgres usually returns uncompressed ones. This means that Martin compresses tiles on each response when tiles are coming from Postgres. The solution is to modify cache logic to store the tile after compressing it. This will make responses much faster except for the very first one (per tile coordinates).

from martin.

nyurik avatar nyurik commented on June 11, 2024

The individual issues #1178 and #1112 track both of the use cases. It should be fairly easy to do - and as always, I am more than willing to guide any newcomers if someone can step forward before I get to it in my limited volunteer time. Thx!

from martin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.