Skip to content

Conversation

CommanderStorm
Copy link
Collaborator

In the previous attempt, I removed the CLI option for this, as caching tiles does not make sense for tile copying.

I forgot that we can also be configured by the config file.

@CommanderStorm CommanderStorm marked this pull request as ready for review August 29, 2025 18:13
@CommanderStorm CommanderStorm changed the title chore(cp): make sure that the cache is always disabled for martin-cp fix(cp): make sure that the cache is always disabled for martin-cp Aug 29, 2025
@nyurik
Copy link
Member

nyurik commented Aug 30, 2025

I am not so sure about this one - if copying from a remote pmtiles source, cache is used for directory caching - you don't want to re-request pmtile indexes on each tile request

@nyurik
Copy link
Member

nyurik commented Aug 30, 2025

we may need to rethink the whole caching strategy. I think i wrote some of these thoughts in some other ticket, but not sure

  • for serving, we need to cache the final tile, sprite, and font results - thus speeding up common tile serving. These are "complex processing -> single URL"
    • we can cache this pre-compression or after-compression -- because the client may want brotli vs gzip - so we can cache the result "as-is" (from the backend), and/or "as-served" (in the compression requested by the client)
    • composite results should be able to re-use the cache
  • for pmtiles we need to cache indexes - internal metadata per tile source, whose results are shared by multiple tile requests
  • for contour / hillshading, we may have to cache internal elevation map which could be used for generating two outputs

@CommanderStorm
Copy link
Collaborator Author

Even if this makes sense for PMTiles directories, it does not make sense to cache PMTiles' tiles.

We definitively need to decouple these caches as pmtiles directory caching imo never makes sense to not have - assuming that we implement the ETAG based invalidation.

@CommanderStorm
Copy link
Collaborator Author

Yea, what you said. I don't like to have so many refactorings ongoing at the same time. I would like to push this refactoring after martin_core.

Not sure if this brings us closer or farther from the caching-refactoring.

@nyurik
Copy link
Member

nyurik commented Aug 30, 2025

sure, but that still leaves the question of martin-cp caching - it seems at least for now we should allow it, or else we are killing pmtiles access performance. Overall for caching, i would prefer a single cache (max MB), but with the ability to configure what gets cached

@CommanderStorm CommanderStorm deleted the better-cp-error-messages branch August 30, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants