Comments (9)
It feels like caching belongs at the client level. My only concern about implementing caching on top of the sdk client (rather than in the sdk itself) is that we're one-level removed from the http request so we can't use any of the existing request caching libraries - most likely having to re-implement parts of those libs including cache keys, headers, invalidation, storage, etc. How heavy of a lift is that likely to be?
from mapbox-cli-py.
Okay, you're right. I'm going to look at making the cache configurable so that we can use the in-memory when we want and a disk cache for the CLI.
from mapbox-cli-py.
With mapbox/mapbox-sdk-py#101 merged, isn't that just a matter of the CLI passing in a different cachecontrol.cache object?
from mapbox-cli-py.
Is there any concern about this making debugging more difficult as we support users? I'm imagining someone who has their ratelimit adjusted upward and expects CLI behavior to respond accordingly. Making plugging in a cache easy sounds great, but I would never expect a command line tool like curl
to do this by default.
from mapbox-cli-py.
@sbma44 I think the idea would be to respect the HTTP headers so we really wouldn't be caching any more aggressively than the API tells us to.
Still, it might make sense to make caching off by default. Turn it on via an optional --cache
or config file? @sgillies what did you have in mind for the interface and configuration?
from mapbox-cli-py.
@sbma44 aren't the cache control and etag headers we send with geocoding responses a signal to clients that they can benefit from caching? Or are those intended mainly for CloudFront?
How about this: no caching by default until we've got the implications of account upgrading figured out and largely solved? Until then, users would be able to set a cache directory in their config file or on the command line.
from mapbox-cli-py.
@sgillies to date I think those headers have been considered solely in the context of CloudFront. Certainly we've never tuned them to my knowledge.
I like your proposed solution/stopgap: make caching easy, but not enabled by default.
from mapbox-cli-py.
I'm going to table this until the CacheControl bug I mentioned in mapbox/mapbox-sdk-py#100 gets fixed.
from mapbox-cli-py.
closed in mapbox/mapbox-sdk-py#100
from mapbox-cli-py.
Related Issues (20)
- Seems to be an off-by-one error in mapbox staticimage HOT 4
- Tileset info incorrect when uploading data files in parallel HOT 2
- Update Directions CLI HOT 5
- python MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead. "Use the matrix module instead.", MapboxDeprecationWarning) HOT 3
- Add mapbox-matrix HOT 2
- Homebrew tap: error & fix HOT 1
- 0.8.0 release
- address Homebrew formula warning HOT 1
- TypeError: request() got an unexpected keyword argument 'json'
- Remove deprecated Distance API
- Remove surface command HOT 1
- Gracefully error when tileset name not specified HOT 2
- Usage of `datasets create-tileset` HOT 1
- Retreiving tilesets HOT 1
- pip install --user mapboxcli doesn't actually install properly on debian 10 (buster) HOT 1
- Update mapbox dependency to support Python 3.9
- error while installing using homebrew HOT 9
- Install Fails on Windows
- Latest version on pypi is no longer installing properly
- Is this project abandoned?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-cli-py.