Search code examples
jsonautocompletetypeahead.jsbootstrap-typeahead

auto complete dropdown with huge and dynamic json file


i am looking for a solution for an auto-complete dropdown box which needs to load entries from a huge json (json file is also being updated / generated every second.)

I tried "typeahead.js" but by default it caches the json file in browser and was not able to display new entries added to json file.

is there a solution for an auto-complete text box which can load entries from the server as fast as possible ?

please suggest. thanks


Solution

  • There are two ways which are mentioned in the documentation for typeahead.js

    You can make the TTL value = 1 for prefetch ( this did;t work for me )

    https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md

    Or you can use clearPrefetchCache on click page load or click of a button .

    category.clearPrefetchCache();