t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
545 stars 68 forks source link

static file for lower zoom and serve dynamically for higher zoom #256

Closed lhapaipai closed 2 years ago

lhapaipai commented 2 years ago

I wonder if it possible to pre-generate the tiles with a low level of zoom, those which are generally the most supplied and therefore take a long time to load and on the other hand to leave to the server the care of dynamically serving the tiles with high level of zoom ?

I am thinking of this option with the cache.file (no for cache.s3) we will specify in the cache configuration a max zoom, we are launching a generation of tiles. And after starting the server, for each request, it checks if it has the cached file otherwise it generates it.

Thanks.

pka commented 2 years ago

This makes absolutely sense and looks like a simple but useful enhancement.

tobwen commented 2 years ago

Yeah, that would be nice. Right now, I'm doing this in the reverse proxy. Small-scale tiles are pre-generated and go to my "static" backend, while large-scale tiles get rendered dynamically.

Would be nice to wrap this up in the backend.

pka commented 2 years ago

The cache_limits settings in https://t-rex.tileserver.ch/doc/reference/#tileset should do this!