Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
1–10 of 74 posts
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#2Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#3I'm using Node.js — with an Express.js router — to power an internal site. We have a few API endpoints which would benefit from this. Does anything need changing when sending the data?
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#4Do you need to stream JSON objects from a server to make this work? You have to get a response from the server in some kind of streaming protocol right?
Or...
Is this just reading the part of the JSON string that it currently has?
I'm inexperienced with streaming, so this might be obvious to some.
EDIT:
Ah, I get it. I was wrong to say it was "streaming". Looks like my second suggestion was the correct one.
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#5Does this require any changes server-side? I'm using Node.js — with an Express.js router — to power an internal site. We have a few API endpoints which would benefit from this. Does anything need changing when sending the data?
Having said that, there's a much bigger improvement if you're progressively writing out the JSON rather than doing it in one big lump.
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#6Does this require any changes server-side? I'm using Node.js — with an Express.js router — to power an internal site. We have a few API endpoints which would benefit from this. Does anything need changing when sending the data?
No changes required. It should accept any JSON resource. Having said that, there's a much bigger improvement if you're progressively writing out the JSON rather than doing it in one big lump.
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#7Very cool, but there's one thing I don't understand. Do you need to stream JSON objects from a server to make this work? You have to get a response from the server in some kind of streaming protocol right? Or... Is this just reading the part of the JSON string that it currently has? I'm inexperienced with streaming, so this might be obvious to some. EDIT: Ah, I get it. I was wrong to say it was "streaming". Looks lik…
Consider if you are writing data from a db: you can either collect all the rows together then write them out, or you can write them out one at a time as you get them. If you write one at a time you are in a sense streaming even if you're not using a streaming protocol.
On a slow network reading any http is like a stream because you can use the first bit to arrive without waiting for the rest. The faster the network the less the benefit but it shouldn't end up worse.
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#8Very cool, but there's one thing I don't understand. Do you need to stream JSON objects from a server to make this work? You have to get a response from the server in some kind of streaming protocol right? Or... Is this just reading the part of the JSON string that it currently has? I'm inexperienced with streaming, so this might be obvious to some. EDIT: Ah, I get it. I was wrong to say it was "streaming". Looks lik…
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#9I might have a pet project this weekend, thanks for sharing.
Re: Oboe.js: reacting to Ajax/Rest quicker by not waiting for it to finish
#10My question: why not modify the backend to accept a request like `/myapp/foods.json` and let the backend compose the json you need & send only that? It seems like fixing it "in the wrong place" to build your frontend to accommodate getting the wrong/too much data. Is this a contrived example that isn't the core usecase? This is my assumption.
Is this primarily for 3rd party APIs and legacy codebases where it's impractical to change the response type & updating to e.g. sockets is impractical? Thanks for the cool project, I apologize for my ignorance wrt whatever points I'm missing!
[0] https://github.com/jimhigson/oboe.js#using-objects-from-the-...