implement proper LRU caching when compressing context