Comments (3)
If I remember right it does parse XML on some endpoints that also support JSON. This was because the structure is subtly different and we don't want to break existing consumers. A major version (1.x.x) release will happen when the client can support POST/PUT ing JSON. At that point we can use semver properly to indicate breaking changes (via a major version number bump)
from 7digital-api.
We've found on the 7digital.com web store, which makes ~2500 API requests per minute, that our application is heavily network bound and the CPU usage is relatively low.
That said XML parsing can become a bottleneck if making lots of concurrent requests for big documents (e.g. search with a big pagesize). We found it was a problem in one place: prefetching entire user lockers (in batches of parrallel requests) under load.
I suspect that's unlikely for a mobile application, but I'm guessing you're concerned about battery life? If you do find hotspots then you can use the technique we used to override the content type by specifying custom headers:
var api = require('7digital');
api
.User({ headers: { Accept: 'application/json' }})
.getLocker({ userId: userId }, console.log);
The JSON support is still very beta and subject to change - so if you do use it you run the risk of things breaking in the future. This is not so much of a problem for us as we can roll out updates quickly to our web applications, not a luxury you have on mobile. Proceed with caution :)
Hope this helps.
from 7digital-api.
Thanks for clarifying Raoul and for giving me the detailed explanation!
Feel free to keep this issue open or closed.
On Wed, Aug 19, 2015 at 10:41 AM, Raoul Millais [email protected]
wrote:
We've found on the 7digital.com web store http://www.7digital.com/,
which makes ~2500 API requests per minute, that our application is heavily
network bound and the CPU usage is relatively low.That said XML parsing can become a bottleneck if making lots of concurrent
requests for big documents (e.g. search with a big pagesize). We found it
was a problem in one place: prefetching entire user lockers (in batches of
parrallel requests) under load.I suspect that's unlikely for a mobile application, but I'm guessing
you're concerned about battery life? If you do find hotspots then you can
use the technique we used to override the content type by specifying custom
headers:var api = require('7digital');
api
.User({ headers: { Accept: 'application/json' }})
.getLocker({ userId: userId }, console.log);The JSON support is still very beta and subject to change - so if you do
use it you run the risk of things breaking in the future. This is not so
much of a problem for us as we can roll out updates quickly to our web
applications, not a luxury you have on mobile. Proceed with caution :)Hope this helps.
—
Reply to this email directly or view it on GitHub
#74 (comment)
.
Daniel Prada
954-990-9846
from 7digital-api.
Related Issues (20)
- Optional promise support
- Add headers to all requests HOT 1
- Remove cache
- Purchasing release and adding credit card data via Partner user account HOT 4
- Null response causes error HOT 2
- Request JSON from API by default where supported by the endpoint
- Renaming cardtypes text node doesnt need to be generic HOT 1
- Will you be supporting the Streaming API? HOT 3
- Remove special case for basket when parsing
- 2-legged signing is broken HOT 1
- When will musicbrainz IDs be supported? HOT 15
- Enable /catalogue/log endpoint support HOT 5
- Access denied /1.2/artist/match/byId HOT 1
- Use xsd to help xml parser with the structure of responses
- Figure out which release have previews
- Update lodash dependency.
- Question: Is this repo the best starting point?
- Does repo still supported?
- How to obtain an API key HOT 1
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 7digital-api.