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

Response caching #186

Open
MichielDeMey opened this issue Oct 12, 2017 · 2 comments
Open

Response caching #186

MichielDeMey opened this issue Oct 12, 2017 · 2 comments

Comments

@MichielDeMey
Copy link
Contributor

We'd need heavy response caching based on the lat/lng since they take quite a while to compute (up to 5s) for a certain coordinate pair.

Would you be up to review a PR containing https://github.com/coderhaoxin/koa-redis-cache?
Or do you have any other suggestions pertaining to result caching?

@glifchits
Copy link
Contributor

Does it make sense to cache isochrones? You would need to round the lat/lng for a cache key that makes sense, and that might cause issues for some use cases (e.g. if you're generating isochrones in a small area within a city, and you move the isochrone origin even a small amount, I'd expect the isochrone to change a little bit; but if it were cached with decreased accuracy coordinates then it wouldn't always change).

I personally would hesitate to use Galton if it forced me to adopt Redis as a dependency just to cache isochrones -- for what we use Galton for, caching would not be helpful.

@MichielDeMey
Copy link
Contributor Author

You make a valid point, and ideally the caching middleware would be optional. It might just be best to pass on this feature request altogether and move caching external to this project.

E.g. By using Varnish or an external microservice with the sole purpose of building a cache.

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

No branches or pull requests

2 participants