O'Reilly logo

Instant typeahead.js by Toby Osbourn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Prefetching data with a server fallback (Should know)

In our last recipe we hit the server with our requests for information, in order to get the fastest results for our users, though we want to minimize the amount of times we talk to the server. For this reason we always try and have something either locally or prefetched before we think about hitting the server.

Getting ready

We are essentially going to chain together what we have learned about prefetching and what we have learned about remote requests. If you need a refresher, I would suggest reading through those two recipes again.

Our requirement is that we want people to search for books on our site. We know that it is not likely to contain any more books written for Sherlock Holmes, and as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required