Ajax on Autocomplete does not fire again, if previously fired
The basic idea behind this is to simply cache the AJAX response of an autocomplete query keyed by the query string itself. Eg.

q = 'I',
cache miss
cache['I'] =&gt; [ 'India', 'Indonesia', 'Italy', 'Iceland' ]
[ 'India', 'Indonesia', 'Italy', 'Iceland' ]

q = 'In'
cache miss
cache['In'] =&gt; [ 'India', 'Indonesia' ]

q = 'I'
cache hit
[ 'India', 'Indonesia', 'Italy', 'Iceland' ]


If you inspect misc/autocomplete.js in Drupal 7, you'd notice that there is a Drupal.ACDB (Autocomplete Database for those curious) object. What's more interesting is the search() method implementation in the same object. You'd notice that given a query string, first the in-memory cache object is looked up first before an AJAX request is made. This is something that you might want to emulate too.