• cache query results so that if you make the same query again, you simply fetch from cache instead of from the server
  • store expensive functions calls and return the cached result when the same input occurs again

Solution 1

Solution 2