I’m building a Rails application that validates user input against an external REST service. I want to bring back a result set matching what they’ve typed in pretty short order. I have a pretty good idea of how I’d retrieve results from the server, but I don’t think a double hop will work very well.
How should I go about this? Should I somehow make the REST requests (including oauth etc) from the browser via javascript? If so, how would I go about doing this?
Thanks!
You definitely want to have the autocomplete roundtrip to go through your backend so that you can deal with these external services going down or returning invalid responses.
You will probably want to cache the more commonly used responses to reduce autocomplete time.