go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.28k stars 194 forks source link

cache is based on map not layer level #768

Closed peerusman closed 3 years ago

peerusman commented 3 years ago

in config.toml i try to create three maps One with all layers and other with one, one layers.

[[maps]]
name = "world"
  [[maps.layers]]
  provider_layer = "test_postgis.wells"
  [[maps.layers]]
  provider_layer = "test_postgis.pipelines"

[[maps]]
name = "pipelines"
  [[maps.layers]]
  provider_layer = "test_postgis.wells"
[[maps]]
name = "wells"
  [[maps.layers]]
  provider_layer = "test_postgis.wells"

The mistake I did is a copy and paste, in pipelines map. i access the layer and it cashed. now I corrected my mistake

[[maps]]
name = "pipelines"

  [[maps.layers]]
  provider_layer = "test_postgis.pipelines" 

image

So the pipeline display with invalid tiles from other layer. I think cache should be on the basis on layers. or it looks for validity if map have same layers or not else invalidate cache for that layer only rest can keep if it is not changed.

ARolek commented 3 years ago

@peerusman did you clean out the cache between those two runs? it looks to me like you're cache is potentially populated with tiles from two different configs.

I think cache should be on the basis on layers.

You could potentially do this by creating several maps with a single layer each and then compositing them on the client. This will require the client to make one request to the server for each "layer".

or it looks for validity if map have same layers or not else invalidate cache for that layer only rest can keep if it is not changed.

I'm not sure I understand what you're looking for tegola to do. Are you suggesting that for each tile generation operation tegola should fetch the tile from the cache if it exists, and then inspect which layers are in the cached tile and compare the layers to the ones in the generated tile to determine if the cached tile should be overwritten?

peerusman commented 3 years ago

ok thanks.