Memoize key function, use HTML local storage to stores last query.