update cache to LRU

the cache used to removed the oldest item when going over the limit, it now removes the least recently used one