Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache configuration #1137

Open
3 tasks
nyurik opened this issue Jan 17, 2024 · 3 comments
Open
3 tasks

Add cache configuration #1137

nyurik opened this issue Jan 17, 2024 · 3 comments
Labels
config Relates to Martin configuration enhancement good first issue help wanted serving Related to web serving component

Comments

@nyurik
Copy link
Member

nyurik commented Jan 17, 2024

Each tile source cache should be configurable, at least to be able to selectively enable/disable cache, but possibly more advanced.

Steps:

  • Add a boolean or a tri-state enum to each tile source config to allow cache=enable|disable|auto. The auto setting (default) should be the same as enable for now, but may become more complex in the future.
  • Make cache configurable per source type (postgres vs mbtiles vs pmtiles)
  • For postgres, make cache configurable for all auto-discoverable tables / functions
@saosebastiao
Copy link

I would like to add that a common use case for caching with tile servers is to have Z-level specific caching. For example, large datasets at low zoom levels are very expensive, but at high zoom levels they are really cheap, so it would be nice to be able to say something like : "for data_source_a I want to cache zoom levels from 0-5 only, but for data_source_b I want to cache zoom from 0-9"

@saosebastiao
Copy link

Additionally, cache invalidation rules...we should be able to specify a TTL at the very least.

An ideal-world scenario, but obviously far more complex is cache invalidation that happens in sync with the database via LISTEN/NOTIFY updates via trigger functions attached to tables.

@bernatfortet
Copy link

I would like to add that a common use case for caching with tile servers is to have Z-level specific caching. For example, large datasets at low zoom levels are very expensive, but at high zoom levels they are really cheap, so it would be nice to be able to say something like : "for data_source_a I want to cache zoom levels from 0-5 only, but for data_source_b I want to cache zoom from 0-9"

This would be amazing to have. In my case, users need to update specific geometries so when that happens the cache needs to be busted. Right now I need to choose between all or northing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Relates to Martin configuration enhancement good first issue help wanted serving Related to web serving component
Projects
None yet
Development

No branches or pull requests

3 participants