ehttp icon indicating copy to clipboard operation
ehttp copied to clipboard

Add support for http caching and keep-alive

Open jprochazk opened this issue 1 year ago • 3 comments

  • [ ] Client that the user can keep around
    • [ ] For native, this would wrap ureq::Agent, and use http-cache-semantics to handle caching
    • [ ] For web, it would delegate everything to fetch (which already handles caching), and hold on state of its own

jprochazk avatar Oct 23 '24 13:10 jprochazk

I'm not 100% but walkers currently doesn't seem to have disk-based tile caching, so everything gets reloaded every launch of the app. It would be great to have that.

BIG CAVEAT: some tile providers (possibly including MapBox) may have restrictions in how a client is allowed to give access users to the raw tiles, or the maximum amount of map data that may be cached, or other such things designed to (legally) prevent scraping.

abey79 avatar Oct 24 '24 08:10 abey79

This is very similar to:

  • https://github.com/emilk/ehttp/issues/4

emilk avatar Oct 24 '24 10:10 emilk

I'm not 100% but walkers currently doesn't seem to have disk-based tile caching

It has, you can enable it by setting a path where you want to store it: https://docs.rs/walkers/latest/walkers/struct.HttpOptions.html#structfield.cache

BIG CAVEAT

Yes, there are plenty, at least on OSM servers: https://github.com/podusowski/walkers/issues/104

podusowski avatar Oct 24 '24 19:10 podusowski