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

Cache Mapbox Tiles #739

Closed
EricPedley opened this issue Oct 16, 2023 · 1 comment
Closed

Cache Mapbox Tiles #739

EricPedley opened this issue Oct 16, 2023 · 1 comment
Labels
backend codefix Refactoring or improving the codebase

Comments

@EricPedley
Copy link
Member

EricPedley commented Oct 16, 2023

During peak usage we go over the mapbox free tier for the tiles API. We could use another tiles provider but I didn't really like how any of them looked (see #730).

To reduce costs, we could cache the tiles we're getting from the API and make our proxy just return results straight from our cache. My current idea is using S3 or something. Important questions to answer while implementing this:

  • How many unique tiles actually are there around the part of the map we want to load?
  • When do we do cache invalidation? (maybe 1 week or something)
  • How much would adding caching slow down the proxy too much for requests that don't get a cache hit?
  • Can we determine which tiles are in cache already and just request straight from S3 instead of going through our Lambda proxy every time?
  • Should we just ditch MapBox's tiles and use a free static tiles provider? I explored this possibility in the past and didn't find any that looked as good, but I'm not gonna discount the possibility that there is some tileset out there that would also work for our purposes. In this case, we only need to proxy the request to the MapBox directions API.

This one is pretty open-ended since there's some interesting system design questions that are unanswered right now.

@EricPedley EricPedley added codefix Refactoring or improving the codebase backend labels Oct 16, 2023
@EricPedley EricPedley moved this to Backlog 🥱 in AntAlmanac Oct 16, 2023
@MinhxNguyen7
Copy link
Member

I'll take a look at this. Not sure if I'm going to take it, but I'm writing this so I don't forget.

@github-project-automation github-project-automation bot moved this from Backlog 🥱 to Done 🤩 in AntAlmanac Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend codefix Refactoring or improving the codebase
Projects
Archived in project
Development

No branches or pull requests

2 participants